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 A65F5386C0A for ; Tue, 7 Apr 2026 06:27:17 +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=1775543241; cv=none; b=U8M8m2wa7S6gDbcAGnUi/4JzCmBJzfNWlcTWGtEc3mk/FqX1TS5tOXgQ9itU9KbLgpuFdV1pC4XVCQHOAw6IpwOxcA3G8/oIxi28xjARdPEjC8SnlLt8MaskvAgWAB1CTSSRaoVplqY2kJ1kMoheS0egRMsKr5WKAuePxd2Uv+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775543241; c=relaxed/simple; bh=bCIRXyb7h+CB+Qd/kHHYv3SA6o++7rvvXRlEGvKXCxE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=h2+J7+YLOqkDzyKshZBw/9xWCpSNorTFW7LXF2efteRIdCZUBvb5eai6jfBcAL9CPlPBrvQwrsv8B1EWgl2S1BowzZCCiSsWcybG3iU81hFLHZQPDBF1ePu6fxOOuO1n8yuYAsioDvz1H32MoB7TLpGseRRmAgO42OfZq3nAyt8= 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=EqT4AlXg; 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="EqT4AlXg" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1775543234; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=jRgffIbQ3Wm7XMbVgBeY8Y4whueyqSiXwa6QomzKNFI=; b=EqT4AlXgvWuPgPPxEET5MGuMyg/HwRSjfIyopKfw2N/GC6cs48UMsmSiQJ3PU5BGZjxwx9fokkXXN7+4SRal/eCoMfryn7IzBz29tfoO3q5GpHSZ9h32wurEY+T8fiMA5Pn2Rvu4k0auWqDl7IxB/+udj42fahDXz6XpBMigyQs= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R581e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=25;SR=0;TI=SMTPD_---0X0atlpk_1775543232; Received: from 30.74.144.138(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X0atlpk_1775543232 cluster:ay36) by smtp.aliyun-inc.com; Tue, 07 Apr 2026 14:27:12 +0800 Message-ID: Date: Tue, 7 Apr 2026 14:27:11 +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: [PATCH v3 14/14] mm/vmscan: unify writeback reclaim statistic and throttling To: kasong@tencent.com, linux-mm@kvack.org Cc: Andrew Morton , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Barry Song , David Stevens , Chen Ridong , Leno Hou , Yafang Shao , Yu Zhao , Zicheng Wang , Kalesh Singh , Suren Baghdasaryan , Chris Li , Vernon Yang , linux-kernel@vger.kernel.org, Qi Zheng References: <20260403-mglru-reclaim-v3-0-a285efd6ff91@tencent.com> <20260403-mglru-reclaim-v3-14-a285efd6ff91@tencent.com> From: Baolin Wang In-Reply-To: <20260403-mglru-reclaim-v3-14-a285efd6ff91@tencent.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/3/26 2:53 AM, Kairui Song via B4 Relay wrote: > From: Kairui Song > > Currently MGLRU and non-MGLRU handle the reclaim statistic and > writeback handling very differently, especially throttling. > Basically MGLRU just ignored the throttling part. > > Let's just unify this part, use a helper to deduplicate the code > so both setups will share the same behavior. > > Test using following reproducer using bash: > > echo "Setup a slow device using dm delay" > dd if=/dev/zero of=/var/tmp/backing bs=1M count=2048 > LOOP=$(losetup --show -f /var/tmp/backing) > mkfs.ext4 -q $LOOP > echo "0 $(blockdev --getsz $LOOP) delay $LOOP 0 0 $LOOP 0 1000" | \ > dmsetup create slow_dev > mkdir -p /mnt/slow && mount /dev/mapper/slow_dev /mnt/slow > > echo "Start writeback pressure" > sync && echo 3 > /proc/sys/vm/drop_caches > mkdir /sys/fs/cgroup/test_wb > echo 128M > /sys/fs/cgroup/test_wb/memory.max > (echo $BASHPID > /sys/fs/cgroup/test_wb/cgroup.procs && \ > dd if=/dev/zero of=/mnt/slow/testfile bs=1M count=192) > > echo "Clean up" > echo "0 $(blockdev --getsz $LOOP) error" | dmsetup load slow_dev > dmsetup resume slow_dev > umount -l /mnt/slow && sync > dmsetup remove slow_dev > > Before this commit, `dd` will get OOM killed immediately if > MGLRU is enabled. Classic LRU is fine. > > After this commit, throttling is now effective and no more spin on > LRU or premature OOM. Stress test on other workloads also looking good. > > Global throttling is not here yet, we will fix that separately later. > > Suggested-by: Chen Ridong > Tested-by: Leno Hou > Signed-off-by: Kairui Song > --- LGTM. Reviewed-by: Baolin Wang