From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-204.mta1.migadu.com [95.215.58.204]) (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 3C386484258 for ; Thu, 3 Sep 2026 11:49:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.204 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788436151; cv=none; b=mrFAGnyncytKI6O1mNkHDMNblhG9z60p1LCowgL8zGd8A8/eNEf5RWjv3dV6AeOBsd+hmNQQnBhOGl5kFuzMT4uV/QOae9kq3xahMCzGl6TRMk0YIRgHsC6VuOBFYpfhjz5RDoNk8EtknONXNSaj9B/awbKA/9H6qHX7D7MA7ZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788436151; c=relaxed/simple; bh=77ef0smQwTHv7ciVNhDJeRJa0P6JZyLYvgjHop8xgXY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dGpBAf0fFA+0ZcIYml0TTAnscc0YO8n/yzkQPKw1o3Co00ZNlrzwbKC+Ef6bFgCo5Z4wSRSljdbolukC0jUXytoWicxuL+0ZPqjVZN7CUteVZSj1DVUiBp12mI/LHu4AIsHs45OE9iALeD+Re5noe6GUlOnRb1wNlHAppcDTioY= 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=dYDWHIDT; arc=none smtp.client-ip=95.215.58.204 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="dYDWHIDT" X-Envelope-To: stable@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=77ef0smQwTHv7ciVNhDJeRJa0P6JZyLYvgjHop8xgXY=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1788436138; v=1; x=1789040938; b=dYDWHIDTEbGhAs2hw9IgZ9BI/vTiXYdWzETIu+pGTJuHqlXPSMQ9DKQqdfvZyDj7T1jvCGX+ o8HJtG0Pl8pWJMOswA4S6444nK5DvVMHYkEsVZS7CQ4oMTckRBpEt7+SJvioo7rwgAl7TYdvlOS EJCmHXCznO90PueLUI6d6Kyk= X-Envelope-To: stable@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 10f1446bfee7baed; Thu, 03 Sep 2026 11:48:47 +0000 X-Mizu-Trace-ID: 10f1446bfee7baed X-Migadu-Flow: FLOW_OUT Message-ID: Date: Thu, 3 Sep 2026 19:48:36 +0800 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] mm/mglru: fix ineffective memory protection for non-kswapd reclaim To: Barry Song Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Andrew Morton , Muchun Song , Kairui Song , Qi Zheng , Axel Rasmussen , Yuanchu Xie , Wei Xu , David Hildenbrand , Lorenzo Stoakes , Chris Down , Tejun Heo , Yu Zhao , "open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)" , "open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)" , linux-kernel@vger.kernel.org, Ridong Chen , stable@vger.kernel.org References: <20260903031952.1120321-1-ridong.chen@linux.dev> <20260903031952.1120321-3-ridong.chen@linux.dev> From: Ridong Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/3/2026 2:30 PM, Barry Song wrote: > On Thu, Sep 3, 2026 at 11:20 AM Ridong Chen wrote: >> >> From: Ridong Chen >> >> For MGLRU, memory.min/low is not honored during global proactive reclaim >> (writing to the root memory.reclaim) and global direct reclaim, because >> these paths shrink memcgs using stale or effective protection (emin/elow). > > Are you sure it should be “stale or effective”? > My gut feeling is that we don't need the “or” here. > My bad. It was a typo. Will remove "or". > [...] >> >> Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists") >> Cc: stable@vger.kernel.org >> Assisted-by: Claude:claude-opus-4-8 >> Signed-off-by: Ridong Chen >> --- > > With a few nits: > > Reviewed-by: Barry Song > > [...] >> diff --git a/mm/vmscan.c b/mm/vmscan.c >> index b4c9b8f3dfe9..500cc2051d13 100644 >> --- a/mm/vmscan.c >> +++ b/mm/vmscan.c >> @@ -5111,7 +5111,13 @@ static int shrink_one(struct lruvec *lruvec, struct scan_control *sc) >> struct mem_cgroup *memcg = lruvec_memcg(lruvec); >> struct pglist_data *pgdat = lruvec_pgdat(lruvec); >> >> - /* lru_gen_age_node() called mem_cgroup_calculate_protection() */ >> + /* >> + * For kswapd, lru_gen_age_node() has already called >> + * mem_cgroup_calculate_protection() >> + */ > > Could be clearer: > > /* > * For kswapd, mem_cgroup_calculate_protection() has already > * been called during the top-down cgroup traversal. > */ > Thank you, will update. >> + if (!current_is_kswapd()) >> + mem_cgroup_calculate_protection_path(NULL, memcg); > > Best Regards > Barry -- Best regards Ridong