]> git.baikalelectronics.ru Git - kernel.git/commit
mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing
authorVlastimil Babka <vbabka@suse.cz>
Thu, 20 May 2021 14:39:51 +0000 (16:39 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Fri, 3 Sep 2021 23:12:22 +0000 (01:12 +0200)
commitc805671381f3ecbc0ab40446605cbd58bb4a011e
treed4cd820ccc1420b57239d2df963e4cb17a4ac806
parentbfbae6f37d16b2cc0ce3d15418ab327ee15c26cb
mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing

Unfreezing partial list can be split to two phases - detaching the list from
struct kmem_cache_cpu, and processing the list. The whole operation does not
need to be protected by disabled irqs. Restructure the code to separate the
detaching (with disabled irqs) and unfreezing (with irq disabling to be reduced
in the next patch).

Also, unfreeze_partials() can be called from another cpu on behalf of a cpu
that is being offlined, where disabling irqs on the local cpu has no sense, so
restructure the code as follows:

- __unfreeze_partials() is the bulk of unfreeze_partials() that processes the
  detached percpu partial list
- unfreeze_partials() detaches list from current cpu with irqs disabled and
  calls __unfreeze_partials()
- unfreeze_partials_cpu() is to be called for the offlined cpu so it needs no
  irq disabling, and is called from __flush_cpu_slab()
- flush_cpu_slab() is for the local cpu thus it needs to call
  unfreeze_partials(). So it can't simply call
  __flush_cpu_slab(smp_processor_id()) anymore and we have to open-code the
  proper calls.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c