From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 3E0802367DF for ; Thu, 2 Apr 2026 02:39:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775097555; cv=none; b=I4yHEbAPIbX/UT2CXZtNcxgQeLbGk7eJsXmAEQTw1/OZtT4rcIc2KM4tb7txCFA5LY+J2PdcCvGUuXaR0K+HCn2ufNQW8oJSc/AasCexQH//uFLrUrEpSl8xG7W17a2XYEz2LVUQTnT33OkWwcKhr1LbfW1bT1x8Elm1HRV429g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775097555; c=relaxed/simple; bh=kC8L3CmcemLECLT84OuwZHOgSlflHdUhoYRhAXdoT2I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q1b+KZeQ/lF47IewhIYBDMF98cLpbY7kyoqDVG06mlF0mH3AQNW0IFOFfZe5LPn9zfgTmhOBQYByZb3nYWwPBjVQ9Uw2AqzIRMVhrCxqXWa0DfNtep8PT3B2uRvKYFvBgwJvT6DgwFKj7RKkyofTdvRZP/uxW79uqiqh3TkJigs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=sAxkuYR9; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="sAxkuYR9" Date: Wed, 1 Apr 2026 19:39:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775097550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=j3m3jQtL7qDYgpW+vrpvI9VfgnJDYp7uTduhdYR8zOE=; b=sAxkuYR9DbGtdMhP/b5j/9a1xBzaSQQky3hhK4fbJndRUz0w+hB5f3aG8Dqbxq0Ltgsgw7 tj3gBwwKl7JE9D4JY+O1IsYR7u67zKQBxwaYC5hIXK0xLrenr5sMbbpqAB/S9XWTxVqgiR 61aDdEtITtihjrCnbCClOZR8StGp0ls= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: kasong@tencent.com Cc: linux-mm@kvack.org, Andrew Morton , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , Qi Zheng , 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 , Baolin Wang Subject: Re: [PATCH v2 12/12] mm/vmscan: unify writeback reclaim statistic and throttling Message-ID: References: <20260329-mglru-reclaim-v2-0-b53a3678513c@tencent.com> <20260329-mglru-reclaim-v2-12-b53a3678513c@tencent.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260329-mglru-reclaim-v2-12-b53a3678513c@tencent.com> X-Migadu-Flow: FLOW_OUT On Sun, Mar 29, 2026 at 03:52:38AM +0800, 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. Also remove the > folio_clear_reclaim in isolate_folio which was actively invalidating > the congestion control. PG_reclaim is now handled by shrink_folio_list, > keeping it in isolate_folio is not helpful. > > 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, congestion control is now effective and no more What do you mean by congestion control here? > spin on LRU or premature OOM. > > Stress test on other workloads also looking good. > > Suggested-by: Chen Ridong > Signed-off-by: Kairui Song There is still differences for global and kswapd reclaim in the shrink_node() like kswapd throttling and congestion state management and throttling. Any plan to unify them?