Skip to content

remove SLOB and allow kfree() with kmem_cache_alloc()

Vlastimil Babka linux-doc linux-fsdevel linux-mm linux-patches lkml rcu 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 6 repliesIn review
  2. v17 patches 25 repliesSuperseded

Changes in v2 from the cover letter

https://lore.kernel.org/all/[email protected]/
- skbuff patch removed from the series as recommended by net folks
- fix up comments in fs/proc/page.c (Hyeonggon)
- removed an extra line in mm/Makefile that I missed (Mike)
- tweak the Documentation wording (Mike)
- added Acks/Reviews - thanks!

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6mm/slob: remove CONFIG_SLOBinit/Kconfig kernel/configs/tiny.config mm/Kconfig +1 more+1 -261 reply
2/6mm, page_flags: remove PG_slob_freeinclude/linux/page-flags.h tools/mm/page-types.c+1 -91 reply
3/6mm, pagemap: remove SLOB and SLQB from comments and documentationDocumentation/admin-guide/mm/pagemap.rst fs/proc/page.c+7 -81 reply
4/6mm/slab: remove CONFIG_SLOB code from slab common codeinclude/linux/slab.h mm/slab.h mm/slab_common.c+0 -1021 reply
5/6mm/slob: remove slob.cmm/slob.c+0 -7571 reply
6/6mm/slab: document kfree() as allowed for kmem_cache_alloc() objectsDocumentation/core-api/memory-allocation.rst include/linux/rcupdate.h mm/slab_common.c+18 -101 reply

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchHyeonggon YooLorenzo StoakesRoman GushchinMike Rapoport (IBM)
1/6A-b A-b A-b
2/6A-b A-b A-b
3/6A-b A-b
4/6R-b A-b A-b
5/6A-b A-b A-b A-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/6] remove SLOB and allow kfree() with kmem_cache_alloc()

Also in git:
https://git.kernel.org/vbabka/h/slab-remove-slob-v2r1

Changes since v1:
https://lore.kernel.org/all/[email protected]/
- skbuff patch removed from the series as recommended by net folks
- fix up comments in fs/proc/page.c (Hyeonggon)
- removed an extra line in mm/Makefile that I missed (Mike)
- tweak the Documentation wording (Mike)
- added Acks/Reviews - thanks!

The SLOB allocator was deprecated in 6.2 so I think we can start exposing the complete removal in for-next (already included as of today) and aim at 6.4 if there are no complaints.

Besides code cleanup, the main immediate benefit will be allowing kfree() family of function to work on kmem_cache_alloc() objects (Patch 6), which was incompatible with SLOB.

This includes kfree_rcu() so I've updated the comment there to remove the mention of potential future addition of kmem_cache_free_rcu() as there should be no need for that now.

Otherwise it's all straightforward removal. After this series, 'git grep slob' or 'git grep SLOB' will have relevant hits in non-mm code:
- tomoyo - patch submitted and carried there, doesn't need to wait for this series
- skbuff - patch to cleanup now-unnecessary #ifdefs will be posted to netdev after this is merged, as requested, to avoid conflicts
- ftrace ring_buffer - patch to remove obsolete comment was submitted

The rest of 'git grep SLOB' hits are false positives, or intentional (CREDITS, and mm/Kconfig SLUB_TINY description to help those that will happen to migrate later).

Vlastimil Babka (6):
mm/slob: remove CONFIG_SLOB
mm, page_flags: remove PG_slob_free
mm, pagemap: remove SLOB and SLQB from comments and documentation mm/slab: remove CONFIG_SLOB code from slab common code mm/slob: remove slob.c
mm/slab: document kfree() as allowed for kmem_cache_alloc() objects

 Documentation/admin-guide/mm/pagemap.rst     |   6 +-
 Documentation/core-api/memory-allocation.rst |  17 +-
 fs/proc/page.c                               |   9 +-
 include/linux/page-flags.h                   |   4 -
 include/linux/rcupdate.h                     |   6 +-
 include/linux/slab.h                         |  39 -
 init/Kconfig                                 |   2 +-
 kernel/configs/tiny.config                   |   1 -
 mm/Kconfig                                   |  22 -
 mm/Makefile                                  |   2 -
 mm/slab.h                                    |  61 --
 mm/slab_common.c                             |   7 +-
 mm/slob.c                                    | 757 -------------------
 tools/mm/page-types.c                        |   6 +-
 14 files changed, 27 insertions(+), 912 deletions(-)
 delete mode 100644 mm/slob.c
Signature · 1 line
2.39.2