From nobody Thu Apr 2 17:36:32 2026 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (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 7A98122301 for ; Thu, 12 Feb 2026 03:21:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770866511; cv=none; b=IrQ3DWBqjEJb/CMeNzmM1shO9h4X3RqZP5IOK/+X3BHgkrwXj/YTk+srGWlQuwMD57wYb+aRjdeKC9p7d+21GeS3/SOt7U9/6bPqoMw33m3X8p56oy9FicbGyKtFL39enAE1fXjgLoAhRCbYOPww0syaQ0In499W1dZgM3jHJCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770866511; c=relaxed/simple; bh=Yl5THP1lnEpG9YmHieL2QiHqbyeNhv5u+iNoEQi7P6w=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=o1umFlggJxvN7QG/25iBh/9FJj0EPMvbyr3cXBrbOE5WFuvfFRBoQCAZjLSiShllxZEse0zdN8M1SPKGSnEgupX/csCqEQy7Dz/ZAqN/+epJNQLYkDpabblE3xhH8DMfZiMd9ROVFKao/M4kjVy3KEcH+EWEuK2qmXMi3RV4X+w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b=wGaPsTk5; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b="wGaPsTk5" Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 61C3LR8E064229; Thu, 12 Feb 2026 11:21:27 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from SHDLP.spreadtrum.com (BJMBX01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4fBLDM17bZz2N6JsN; Thu, 12 Feb 2026 11:21:07 +0800 (CST) Received: from bj03382pcu03.spreadtrum.com (10.0.73.40) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 12 Feb 2026 11:21:25 +0800 From: "zhaoyang.huang" To: Andrew Morton , Yu Zhao , Michal Hocko , Rik van Riel , Shakeel Butt , Roman Gushchin , Johannes Weiner , "T . J . Mercier" , , , Zhaoyang Huang , Subject: [PATCH] mm: remove '!root_reclaim' checking in should_abort_scan() Date: Thu, 12 Feb 2026 11:21:11 +0800 Message-ID: <20260212032111.408865-1-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 61C3LR8E064229 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1770866497; bh=QdCMFrzogHkQ8spZQwepKtQEezu1njOGBCSt6rWNZlg=; h=From:To:Subject:Date; b=wGaPsTk5TV4H4PErTPLlAMsGKYec+H7w4lynxRq2fSfwqbZuK6dIg1nwXzTmIm+sf xCm+uT4IIc+01tdSUVmU95iP5sJvJ5C+Q3OVO/gMMKL2fd3VLS03P2XZPT/GqOyJA4 Uy4t29o1Sbdvgs72C4XEmadrRX39Qk4hBeP0WMpEUZZxv653sr+d9EH/eR3gZQpJIm 7jUoTyLpjuiwXxI3c1uJveEypX1FUsurgt7eRYFINWxPedJQuN09HFgHDG1vy/rEPL 77mRLKdIe3o4+DQUEIGf8gfBGnT56L3XVd8oqnMT0EIDn6VsLNuNlE1fMLQ0gRN3a7 U43E7/iII/mLg== Content-Type: text/plain; charset="utf-8" From: Zhaoyang Huang Nowadays, ANDROID system replaces madivse with memory.reclaim to implement user space memory management which desires to reclaim a certain amount of memcg's memory. However, oversized reclaiming and high latency are observed as there is no limitation over nr_reclaimed inside try_to_shrink_lruvec when MGLRU enabled. Besides, this could also affect all none root_reclaim such as reclaim_high etc. Since the commit 'b82b530740b9' ("mm: vmscan: restore incremental cgroup iteration") introduces sc->memcg_full_walk to limit the walk range of mem_cgroup_iter and keep the fairness among the descendants of one memcg. This commit would like to make single memcg's scanning more precised by removing the criteria of 'if (!root_reclaim)' inside should_abort_scan(). Suggested-by: T.J.Mercier Signed-off-by: Zhaoyang Huang Reviewed-by: T.J. Mercier --- mm/vmscan.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 670fe9fae5ba..9d900be478ea 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4832,10 +4832,6 @@ static bool should_abort_scan(struct lruvec *lruvec,= struct scan_control *sc) int i; enum zone_watermarks mark; =20 - /* don't abort memcg reclaim to ensure fairness */ - if (!root_reclaim(sc)) - return false; - if (sc->nr_reclaimed >=3D max(sc->nr_to_reclaim, compact_gap(sc->order))) return true; =20 --=20 2.25.1