From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 57FD23F87ED for ; Wed, 18 Mar 2026 20:13:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773864821; cv=none; b=obb19Zn7EwuBpIJUE7yVLMBr0AM2Wi4OCYM8FkYopI0+rl3DsTYBlTiuzAK/Qk2SjT06yUFPZCJMozJpjF9a75roIdy9uth5DkZseHKvBH2TTkZvoXcrkywc8lGkSnbS2aLYuu8FOJxeIrRtLiI8Toa2E8Of6l67+TDJ2ZGnWcQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773864821; c=relaxed/simple; bh=sSCUe7dz4qs/faWJnv7uxYez/hljOQ2lmKjiva25TeY=; h=Date:To:From:Subject:Message-Id; b=ho4QlaAr850m970qHc8oVVNEy88RdsgaQrnKiiosTC28Yxl92QUGWYP3KXaQDcDUm4qURZ8qYUhve1mryT/0Fy/sZHlgGQMOUHj09SkyR16HJh/t1PVX/j/tJpdmeYuNqHIcGVKcwI45qQHcL8G5qcD+JlDErhyyRjU2QSciQEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=UMo1BHZL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="UMo1BHZL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77425C19421; Wed, 18 Mar 2026 20:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1773864820; bh=sSCUe7dz4qs/faWJnv7uxYez/hljOQ2lmKjiva25TeY=; h=Date:To:From:Subject:From; b=UMo1BHZLKN5elBga0smR8qQ9K8Y4lE4xb1bYmo5ShCmmtu4P6915Tt8VAOa2l4hQE lH5jb3CJKTsFeSK22lhlnukJleEAqhugBokmo90r2V2liCivM3PpJpi1CMQTQUxCFA jdexExv2pLinGaUvamKAtMF7DnrMGWWIva3u8Fb0= Date: Wed, 18 Mar 2026 13:13:40 -0700 To: mm-commits@vger.kernel.org,ziy@nvidia.com,yuanchu@google.com,weixugc@google.com,vbabka@kernel.org,surenb@google.com,shakeel.butt@linux.dev,ryan.roberts@arm.com,rppt@kernel.org,roman.gushchin@linux.dev,npache@redhat.com,muchun.song@linux.dev,mhocko@kernel.org,ljs@kernel.org,liam.howlett@oracle.com,lance.yang@linux.dev,dev.jain@arm.com,david@kernel.org,david@fromorbit.com,baolin.wang@linux.alibaba.com,baohua@kernel.org,axelrasmussen@google.com,hannes@cmpxchg.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-list_lru-deduplicate-lock_list_lru.patch added to mm-new branch Message-Id: <20260318201340.77425C19421@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm: list_lru: deduplicate lock_list_lru() has been added to the -mm mm-new branch. Its filename is mm-list_lru-deduplicate-lock_list_lru.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-list_lru-deduplicate-lock_list_lru.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Johannes Weiner Subject: mm: list_lru: deduplicate lock_list_lru() Date: Wed, 18 Mar 2026 15:53:22 -0400 The MEMCG and !MEMCG paths have the same pattern. Share the code. Link: https://lkml.kernel.org/r/20260318200352.1039011-5-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Reviewed-by: David Hildenbrand (Arm) Cc: Axel Rasmussen Cc: Baolin Wang Cc: Barry Song Cc: Dave Chinner Cc: Dev Jain Cc: Lance Yang Cc: Liam Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Nico Pache Cc: Roman Gushchin Cc: Ryan Roberts Cc: Shakeel Butt Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Wei Xu Cc: Yuanchu Xie Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/list_lru.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) --- a/mm/list_lru.c~mm-list_lru-deduplicate-lock_list_lru +++ a/mm/list_lru.c @@ -15,6 +15,14 @@ #include "slab.h" #include "internal.h" +static inline void lock_list_lru(struct list_lru_one *l, bool irq) +{ + if (irq) + spin_lock_irq(&l->lock); + else + spin_lock(&l->lock); +} + static inline void unlock_list_lru(struct list_lru_one *l, bool irq_off) { if (irq_off) @@ -68,14 +76,6 @@ list_lru_from_memcg_idx(struct list_lru return &lru->node[nid].lru; } -static inline void lock_list_lru(struct list_lru_one *l, bool irq) -{ - if (irq) - spin_lock_irq(&l->lock); - else - spin_lock(&l->lock); -} - static inline struct list_lru_one * lock_list_lru_of_memcg(struct list_lru *lru, int nid, struct mem_cgroup *memcg, bool irq, bool skip_empty) @@ -136,10 +136,7 @@ lock_list_lru_of_memcg(struct list_lru * { struct list_lru_one *l = &lru->node[nid].lru; - if (irq) - spin_lock_irq(&l->lock); - else - spin_lock(&l->lock); + lock_list_lru(l, irq); return l; } _ Patches currently in -mm which might be from hannes@cmpxchg.org are mm-vmalloc-streamline-vmalloc-memory-accounting.patch mm-memcontrol-switch-to-native-nr_vmalloc-vmstat-counter.patch mm-memcontrol-split-out-__obj_cgroup_charge.patch mm-memcontrol-use-__account_obj_stock-in-the-locked-path.patch mm-memcg-separate-slab-stat-accounting-from-objcg-charge-cache.patch mm-list_lru-lock_list_lru_of_memcg-cannot-return-null-if-skip_empty.patch mm-list_lru-deduplicate-unlock_list_lru.patch mm-list_lru-move-list-dead-check-to-lock_list_lru_of_memcg.patch mm-list_lru-deduplicate-lock_list_lru.patch mm-list_lru-introduce-caller-locking-for-additions-and-deletions.patch mm-list_lru-introduce-folio_memcg_list_lru_alloc.patch mm-switch-deferred-split-shrinker-to-list_lru.patch