From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-100.ptr.blmpb.com (sg-1-100.ptr.blmpb.com [118.26.132.100]) (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 10B0823ABBD for ; Wed, 26 Nov 2025 02:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764125389; cv=none; b=icjZHvckixeWpCf476FFIhQdKXbrE/bzDu0WG4yNr4ct4zkfhYU6VGu8sHrXazQzXer9zqnAGiK5Qp81t4Od9ECajlFuw9Scn8Ptv+cw1YJKlJ+eWUV0zSDUr+MPtIULyYkJD15NF/YRYPwbj2E/H0FMqxucGhTYE6AvqoJTJu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764125389; c=relaxed/simple; bh=fD3hfo8OYSfdmXmreFkB4jWz4VPVqv6n/3eyy0P3pmE=; h=References:To:Subject:In-Reply-To:From:Date:Content-Type: Mime-Version:Cc:Message-Id; b=d1EmIanpPBJbKMao9nMErBHWemJn5fGFRf3I58CVARnEd2DfrloP+vVNRitEBAApb4pZqj5UfnivmLNYcTkgQ/dLAoWu5AA67Mztiss8K2A7OeK2+jyT2hS22NKqWFffYxuuPPG5Snf9nxgnM37vHZD6Hke21XcsvlwTWXtO+rc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=BrbkkfWY; arc=none smtp.client-ip=118.26.132.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="BrbkkfWY" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1764125374; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=UnzWgwkKcFm0gU3oBGsqS8ePUelMPsY6QLSmu1dv/sA=; b=BrbkkfWYa2fAd1HS0Q5g0vSA5Cz9j0XaeL7CLGQmDmeWDNj1w04DEQBhwnUrkXbAXLA41J PVfDBoFMDY2i2VWLVR258v1abbzud35z1qjLN3VF5sc1awCCHMf5nmUTPGR5S0SoY/EvUn eFx3VrU1OoMyDNssGzl5o8qjeUJgmxjcECg1qS3K+DTEUlPut1eeMMPA61BPuQbnrKfEYx UFGd2Vt2Tu/tPfjVLA84mxsPbiAo7vDXFLJv6f1dYvKC7nsXKnbSejRyxHbk+c4Y0IVkv7 mR/d+HIp2sSxxKXzcsBslCGc3qtmTiuwTTxNGCdnXJFNq49vbGPKYDciUPG4cA== X-Original-From: Qi Zheng References: <20251126020435.1511637-1-chenridong@huaweicloud.com> Content-Transfer-Encoding: 7bit To: "Chen Ridong" , , , , , , , , , , , Subject: Re: [PATCH -next] memcg: Remove inc/dec_lruvec_kmem_state helpers In-Reply-To: <20251126020435.1511637-1-chenridong@huaweicloud.com> User-Agent: Mozilla Thunderbird From: "Qi Zheng" Date: Wed, 26 Nov 2025 10:49:14 +0800 Content-Type: text/plain; charset=UTF-8 X-Lms-Return-Path: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Cc: , , , , Message-Id: On 11/26/25 10:04 AM, Chen Ridong wrote: > From: Chen Ridong > > The dec_lruvec_kmem_state helper is unused by any caller and can be safely > removed. Meanwhile, the inc_lruvec_kmem_state helper is only referenced by > shadow_lru_isolate, retaining these two helpers is unnecessary. This patch > removes both helper functions to eliminate redundant code. Make sense. Acked-by: Qi Zheng > > Signed-off-by: Chen Ridong > --- > include/linux/memcontrol.h | 10 ---------- > mm/workingset.c | 2 +- > 2 files changed, 1 insertion(+), 11 deletions(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index d35390f9892a..0651865a4564 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -1452,16 +1452,6 @@ struct slabobj_ext { > #endif > } __aligned(8); > > -static inline void inc_lruvec_kmem_state(void *p, enum node_stat_item idx) > -{ > - mod_lruvec_kmem_state(p, idx, 1); > -} > - > -static inline void dec_lruvec_kmem_state(void *p, enum node_stat_item idx) > -{ > - mod_lruvec_kmem_state(p, idx, -1); > -} > - > static inline struct lruvec *parent_lruvec(struct lruvec *lruvec) > { > struct mem_cgroup *memcg; > diff --git a/mm/workingset.c b/mm/workingset.c > index 892f6fe94ea9..e9f05634747a 100644 > --- a/mm/workingset.c > +++ b/mm/workingset.c > @@ -749,7 +749,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, > if (WARN_ON_ONCE(node->count != node->nr_values)) > goto out_invalid; > xa_delete_node(node, workingset_update_node); > - inc_lruvec_kmem_state(node, WORKINGSET_NODERECLAIM); > + mod_lruvec_kmem_state(node, WORKINGSET_NODERECLAIM, 1); > > out_invalid: > xa_unlock_irq(&mapping->i_pages);