From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C152D36AB46 for ; Fri, 27 Mar 2026 10:04:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.118 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774605893; cv=none; b=rYAnMPDQbwn+CflovZxzolJVlOO44xoKZeNgSomkU2pRrSla0UA1WE1VrB+WxS3jZ3wHT/OJOM20RpA5bbonFL73cjAdxPufFH0R8j7Fb48rLtcck62c14+VAJEGfr+b+EWvDEnj6XdhTW1y6/HJCtypH8dydRexzpzktR30m2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774605893; c=relaxed/simple; bh=3W1w54Hh3v0g5AICzZO2y0hEYGH4TulvPAh8Um3DQDk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mkuGbyWhC/7yXdCzJIeVWAmLWDqLs5Jn3qX4SZcDWBcxkOOtzJLe996LWqQ0GbC6NIRFM8yMsHuy03sXpDM2fJvnXbVJivx2ZztBIyiitdSQBgjmi2DF33FSPl0LnC4ODyOsc0wWJcXByBQVBj8hPDgY/D+LI/qu1XSO5lmrgkI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=elSYnEeV; arc=none smtp.client-ip=115.124.30.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="elSYnEeV" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1774605886; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=3pcclGAw2n0ERSdgcxRd/f1n8hL4Vj2lV1ZnDYVVzEg=; b=elSYnEeV7UF+aI80w4Zyev0IeypQJkr+4lGMvdJZzqpo3L0mQvLSyPY/WoS8tNp8B4rPUVQhBljiJNXG8GiiWUMXhjicEGraD04icUDhqOogpL92m8mUtH6ZPhrThzMNKGakin4Y6ewkvhPSZII8P0QqQFgwQiyL4J/SvGhBHRQ= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0X.nyg9A_1774605885; Received: from 30.74.146.57(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X.nyg9A_1774605885 cluster:ay36) by smtp.aliyun-inc.com; Fri, 27 Mar 2026 18:04:46 +0800 Message-ID: <1ff07ca1-8a64-43dd-85e3-9aa963c24b55@linux.alibaba.com> Date: Fri, 27 Mar 2026 18:04:45 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH] mm: vmscan: fix dirty folios throttling on cgroup v1 for MGLRU To: Kairui Song Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, david@kernel.org, mhocko@kernel.org, zhengqi.arch@bytedance.com, shakeel.butt@linux.dev, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, baohua@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/27/26 5:45 PM, Kairui Song wrote: > On Wed, Mar 25, 2026 at 8:06 PM Baolin Wang > wrote: >> >> The balance_dirty_pages() won't do the dirty folios throttling on cgroupv1. >> See commit 9badce000e2c ("cgroup, writeback: don't enable cgroup writeback >> on traditional hierarchies"). >> >> Moreover, after commit 6b0dfabb3555 ("fs: Remove aops->writepage"), we no >> longer attempt to write back filesystem folios through reclaim. >> >> On large memory systems, the flusher may not be able to write back quickly >> enough. Consequently, MGLRU will encounter many folios that are already >> under writeback. Since we cannot reclaim these dirty folios, the system >> may run out of memory and trigger the OOM killer. >> >> Hence, for cgroup v1, let's throttle reclaim after waking up the flusher, >> which is similar to commit 81a70c21d917 ("mm/cgroup/reclaim: fix dirty >> pages throttling on cgroup v1"), to avoid unnecessary OOM. >> >> The following test program can easily reproduce the OOM issue. With this patch >> applied, the test passes successfully. >> >> $mkdir /sys/fs/cgroup/memory/test >> $echo 256M > /sys/fs/cgroup/memory/test/memory.limit_in_bytes >> $echo $$ > /sys/fs/cgroup/memory/test/cgroup.procs >> $dd if=/dev/zero of=/mnt/data.bin bs=1M count=800 >> >> Signed-off-by: Baolin Wang > > I've been testing and based a few patches based on this and it looks > good enough as a bug fix: > > Reviewed-by: Kairui Song Thanks.