From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2068C374758 for ; Sun, 26 Jul 2026 01:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785029397; cv=none; b=gABCK18Ooe19PHVkKjGDU1CMlRPWQKXIRl1DSAihI2uFZs1qOglw3PsNXgOFDxyT7A6kwCgaPdwrWxqvcQYQNBhV1k1rfEDPitF3GxEh1encDgCxxYRbFY0f0ypCLILynFIQ7y1eHBfXWUZxr0lnfO3RjEEeizp6WOpXSSF8X/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785029397; c=relaxed/simple; bh=rX7sXIqXTe8QOI255WotO7fHPjfhkqHonRKt48MCS0I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SU8Z2Z+7TAaakqn8muMCxgWMX2OF5mInmZGUQEf8tWGr4L+7MLTfoDzXyLxB2MhPoR3raPePj/7vcYaooNTUJumjkh3/w/Fh7dKGklXTacaYP8BPk5aXSDGl0RuJg3WfnzETB5LGLiF0qIn9Bs/mUEi96kSstRYwedKdQenSyvw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E1KtG1cB; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E1KtG1cB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A24A1F00A3E; Sun, 26 Jul 2026 01:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785029395; bh=Y1405Ze3xDfa95m+4L62HBoV5HB+8jDRTFTlAXIoI1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E1KtG1cBh3txhpViXIqbLP0yE3ILIk9Rhj9EXYQke/MQNX6103UJDdN6gnsRa6WkD CLHYf9bkoAI69RVJ+ES7fQkYB3jxvRUP15khmt9OYBiN6JtBxNKCF6sxmmmy5XNKoH yJ4y/vUsDT3mxdHKl26XVe+qiEpdbsuyi08ojNLpEPx7tcykHE023zcHS9H4az/Qb8 faN8hTnEeD6RundhoGRduKJLDtqFE8KU/9Lo6M7eDs5IJWT8FRJkPFVXF3sUmsTSUg bOWFm7Wldx3+mSxNLm0coq83E5sXZQ8grBhSPJG+7jSo2qSJJYch4LwDk+UBwuYDab D0I59yXBHHOmA== From: "Barry Song (Xiaomi)" To: akpm@linux-foundation.org, linux-mm@kvack.org Cc: hannes@cmpxchg.org, david@kernel.org, mhocko@kernel.org, qi.zheng@linux.dev, shakeel.butt@linux.dev, ljs@kernel.org, kasong@tencent.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, linux-kernel@vger.kernel.org, lyugaofei@xiaomi.com, stevensd@chromium.org, "Barry Song (Xiaomi)" Subject: [RFC PATCH 1/4] mm: mglru: only fall back when reclaim is running at high priority Date: Sun, 26 Jul 2026 09:29:43 +0800 Message-Id: <20260726012946.18684-2-baohua@kernel.org> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20260726012946.18684-1-baohua@kernel.org> References: <20260726012946.18684-1-baohua@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Respect the type selected by positive_ctrl_err(), where swappiness controls the relative weights of SP and PV. Falling back too readily violates that bias. Signed-off-by: Barry Song (Xiaomi) --- mm/vmscan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 566c4e837c7d..f79402760776 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4855,9 +4855,12 @@ static int isolate_folios(unsigned long nr_to_scan, struct lruvec *lruvec, * If scanned > 0 and isolated == 0, avoid falling back to the * other type, as this type remains sufficient. Falling back * too readily can disrupt the positive_ctrl_err() bias. + * Only fall back when reclaim is running at high priority. */ - if (!scanned) - type = !type; + if (!scanned) { + if (!sc->priority) + type = !type; + } } return total_scanned; -- 2.39.3 (Apple Git-146)