Linux-mm Archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	patches@lists.linux.dev,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Chengming Zhou <chengming.zhou@linux.dev>
Subject: [GIT PULL] slab updates for 6.10
Date: Thu, 9 May 2024 16:25:05 +0200	[thread overview]
Message-ID: <587f5e6b-d543-4028-85c8-93cc8f581d02@suse.cz> (raw)

Hi Linus,

please pull the latest slab updates from:

  git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git tags/slab-for-6.10

Sending this early due to upcoming LSF/MM travel and chances there's no rc8.

Thanks,
Vlastimil

======================================

This time it's mostly random cleanups and fixes, with two performance fixes
that might have significant impact, but limited to systems experiencing
particular bad corner case scenarios rather than general performance
improvements.

The memcg hook changes are going through the mm tree due to dependencies.

- Prevent stalls when reading /proc/slabinfo (Jianfeng Wang)

  This fixes the long-standing problem that can happen with workloads that have
  alloc/free patterns resulting in many partially used slabs (in e.g. dentry
  cache). Reading /proc/slabinfo will traverse the long partial slab list under
  spinlock with disabled irqs and thus can stall other processes or even
  trigger the lockup detection. The traversal is only done to count free
  objects so that <active_objs> column can be reported along with <num_objs>.

  To avoid affecting fast paths with another shared counter (attempted in the
  past) or complex partial list traversal schemes that allow rescheduling, the
  chosen solution resorts to approximation - when the partial list is over
  10000 slabs long, we will only traverse first 5000 slabs from head and tail
  each and use the average of those to estimate the whole list. Both head and
  tail are used as the slabs near head to tend to have more free objects than
  the slabs towards the tail.

  It is expected the approximation should not break existing /proc/slabinfo
  consumers. The <num_objs> field is still accurate and reflects the overall
  kmem_cache footprint. The <active_objs> was already imprecise due to cpu and
  percpu-partial slabs, so can't be relied upon to determine exact cache usage.
  The difference between <active_objs> and <num_objs> is mainly useful to
  determine the slab fragmentation, and that will be possible even with the
  approximation in place.

- Prevent allocating many slabs when a NUMA node is full (Chen Jun)

  Currently, on NUMA systems with a node under significantly bigger pressure
  than other nodes, the fallback strategy may result in each kmalloc_node()
  that can't be safisfied from the preferred node, to allocate a new slab on a
  fallback node, and not reuse the slabs already on that node's partial list.

  This is now fixed and partial lists of fallback nodes are checked even for
  kmalloc_node() allocations. It's still preferred to allocate a new slab on
  the requested node before a fallback, but only with a GFP_NOWAIT attempt,
  which will fail quickly when the node is under a significant memory pressure.

- More SLAB removal related cleanups (Xiu Jianfeng, Hyunmin Lee)

- Fix slub_kunit self-test with hardened freelists (Guenter Roeck)

- Mark racy accesses for KCSAN (linke li)

- Misc cleanups (Xiongwei Song, Haifeng Xu, Sangyun Kim)

----------------------------------------------------------------
Chen Jun (1):
      mm/slub: Reduce memory consumption in extreme scenarios

Guenter Roeck (1):
      mm/slub, kunit: Use inverted data to corrupt kmem cache

Haifeng Xu (1):
      slub: Set __GFP_COMP in kmem_cache by default

Hyunmin Lee (2):
      mm/slub: create kmalloc 96 and 192 caches regardless cache size order
      mm/slub: remove the check for NULL kmalloc_caches

Jianfeng Wang (2):
      slub: introduce count_partial_free_approx()
      slub: use count_partial_free_approx() in slab_out_of_memory()

Sangyun Kim (1):
      mm/slub: remove duplicate initialization for early_kmem_cache_node_alloc()

Xiongwei Song (3):
      mm/slub: remove the check of !kmem_cache_has_cpu_partial()
      mm/slub: add slub_get_cpu_partial() helper
      mm/slub: simplify get_partial_node()

Xiu Jianfeng (2):
      mm/slub: remove dummy slabinfo functions
      mm/slub: correct comment in do_slab_free()

linke li (2):
      mm/slub: mark racy accesses on slab->slabs
      mm/slub: mark racy access on slab->freelist

 lib/slub_kunit.c |   2 +-
 mm/slab.h        |   3 --
 mm/slab_common.c |  27 +++++--------
 mm/slub.c        | 118 ++++++++++++++++++++++++++++++++++++++++---------------
 4 files changed, 96 insertions(+), 54 deletions(-)


             reply	other threads:[~2024-05-09 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 14:25 Vlastimil Babka [this message]
2024-05-13 17:33 ` [GIT PULL] slab updates for 6.10 Linus Torvalds
2024-05-20 10:18   ` Vlastimil Babka
2024-05-13 17:38 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=587f5e6b-d543-4028-85c8-93cc8f581d02@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=patches@lists.linux.dev \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).