From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-105.mta0.migadu.com [91.218.175.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54607415F1C for ; Fri, 28 Aug 2026 11:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.105 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787915397; cv=none; b=gm2N+JHEeVIdlWJxB3fdh7GRHaS+vbsIRK/FlBJoaRGHnjiWKeorZNAWYaO1ehViL5aDjOAB0GLZMAnv8SYWm2oePDKooVb5J8FxIkbz6e2Z5xh6MIAVqYXlqDe9mg6yz5hoGQd7WLNopqqlj0K2OaqdriW2QLBhyQ3fUXdbVGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787915397; c=relaxed/simple; bh=aB2sPXe8ZSnNuzSPG400K7+aKsUxWLpt5p1IJqhSTDk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=SL0YqRRjFi/Ndp8AzlShCPaZkCld0+/KUzi9AUmi4ElKr0UyYX3LgLl91CDtplOFNNh6AUTypGBf9Ci6tZn9SJiEEu6hheqEm2xn1V2MZICZ/rkBjjMupksCI0R5MCcuJ+SVYTERTJhJFVkbnmzXfOCrjAT8FGguzblnyr4v510= 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=q/MAiruP; arc=none smtp.client-ip=91.218.175.105 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="q/MAiruP" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=aB2sPXe8ZSnNuzSPG400K7+aKsUxWLpt5p1IJqhSTDk=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787915389; v=1; x=1788520189; b=q/MAiruP6z7DqG5e7rjLjwFB90It1swu5Sln7BlhPNHhSxMuHu04+R3WTwqw6+bX04y4J8R0 Xx4VxquQEKd3tpIcY7AF18o/gA/YXvLX2apf7y+ZCXsHrIcA8EZcl9031LR3tSJXkAQAPMpc2o/ UgkEKFX0fK6BNm1JXWPD4ulw= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 55830487e16c8120; Fri, 28 Aug 2026 11:09:39 +0000 X-Mizu-Trace-ID: 55830487e16c8120 X-Migadu-Flow: FLOW_OUT From: Ridong Chen To: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Andrew Morton Cc: Muchun Song , Kairui Song , Qi Zheng , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , David Hildenbrand , Lorenzo Stoakes , Chris Down , Tejun Heo , Yu Zhao , cgroups@vger.kernel.org (open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)), linux-mm@kvack.org (open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)), linux-kernel@vger.kernel.org, Ridong Chen , Ridong Chen Subject: [PATCH v2 0/2] mm/mglru: fix ineffective memory protection for non-kswapd reclaim Date: Fri, 28 Aug 2026 19:09:17 +0800 Message-Id: <20260828110919.1324028-1-ridong.chen@linux.dev> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ridong Chen This series fixes memory.min/low being silently bypassed for MGLRU during non-kswapd global reclaim (global direct reclaim and root-level memory.reclaim). Patch 2 is the actual fix. Patch 1 is a prerequisite: an integer overflow in effective_protection(), spotted by the sashiko review tool, which patch 2's new caller would also be exposed to. --- v2: - Fix an issue caused by non-atomic read races in patch 1 [1] [1] https://sashiko.dev/#/patchset/20260828092432.1257917-1-ridong.chen@linux.dev?part=1 Ridong Chen (2): mm/page_counter: avoid integer overflow in effective_protection() mm/mglru: fix ineffective memory protection for non-kswapd reclaim include/linux/memcontrol.h | 11 ++++++++++ mm/memcontrol.c | 45 ++++++++++++++++++++++++++++++++++++++ mm/page_counter.c | 19 +++++++++++----- mm/vmscan.c | 8 ++++++- 4 files changed, 76 insertions(+), 7 deletions(-) -- 2.34.1