All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Matthew Wilcox <willy@infradead.org>,
	Christoph Lameter <cl@linux.com>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Pekka Enberg <penberg@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: slab tree for next
Date: Thu, 2 Dec 2021 17:36:45 +0100	[thread overview]
Message-ID: <87d57688-cdcc-07c5-d63d-397806e7ed03@suse.cz> (raw)
In-Reply-To: <5387ebfe-03d0-0247-e3ce-97965d5f941c@suse.cz>

On 12/1/21 21:34, Vlastimil Babka wrote:
> On 12/1/21 19:39, Vlastimil Babka wrote:
>> On 12/1/21 19:14, Vlastimil Babka wrote:
>>> Folks from non-slab subsystems are Cc'd only to patches affecting them, and
>>> this cover letter.
>>>
>>> Series also available in git, based on 5.16-rc3:
>>> https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=slab-struct_slab-v2r2
>>>
>>> The plan: as my SLUB PREEMPT_RT series in 5.15, I would prefer to go again with
>>> the git pull request way of eventually merging this, as it's also not a small
>>> series. I will thus reply to this mail with asking to include my branch in
>>> linux-next.
>>>
>>> As stated in the v1/RFC cover letter, I wouldn't mind to then continue with
>>> maintaining a git tree for all slab patches in general. It was apparently
>>> already done that way before, by Pekka:
>>> https://lore.kernel.org/linux-mm/alpine.DEB.2.00.1107221108190.2996@tiger/
>> 
>> Hi Stephen,
>> 
>> Please include a new tree in linux-next:
> 
> OK, not yet, please:
> https://lore.kernel.org/all/70fbdc70-6838-0740-43e3-ed20caff47bf@arm.com/
> 
> I will reorder the patches so that changes needed in other subsystems
> and the dependent actual removal of slab fields from struct page will be
> ordered last, and only ask for the first, mm/ contained part to be in
> -next. The patches for other subsystems can then be reviewed and picked
> by their maintainers independently, while slab implementations are
> already using struct slab.

OK, I've did that and removed the iommu commit, and the dependent removal of
slab-specific struct page fields, until that is resolved. slab
implementatiosn is nevertheless converted  to struct slab, and zsmalloc and
bootmem stop using the slab's struct page fields, so the struct page cleanup
can be finished any time later when iommu is dealt with.

> 
>> git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git slab-next

So the 'slab-next' branch is now ready for linux-next, now identical to
branch slab-struct_slab-v3r1, head 	d395d823b3ae.

>> i.e.
>> https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=slab-next
>> 
>> Which now is identical slab-struct_slab-v2r2 branch [1]
>> 
>> When I tried to merge this to next-20211201, there were minor conflicts with
>> two patches from motm:
>> zsmalloc-move-huge-compressed-obj-from-page-to-zspage.patch
>> mm-memcg-relocate-mod_objcg_mlstate-get_obj_stock-and-put_obj_stock.patch
>> 
>> Both appear to be just a change in context.
>> 
>> Thanks,
>> Vlastimil
>> 
>> [1] https://lore.kernel.org/all/20211201181510.18784-1-vbabka@suse.cz/
>> 
>>> Changes from v1/RFC:
>>> https://lore.kernel.org/all/20211116001628.24216-1-vbabka@suse.cz/
>>> - Added virt_to_folio() and folio_address() in the new Patch 1.
>>> - Addressed feedback from Andrey Konovalov and Matthew Wilcox (Thanks!)
>>> - Added Tested-by: Marco Elver for the KFENCE parts (Thanks!)
>>>
>>> Previous version from Matthew Wilcox:
>>> https://lore.kernel.org/all/20211004134650.4031813-1-willy@infradead.org/
>>>
>>> LWN coverage of the above:
>>> https://lwn.net/Articles/871982/
>>>
>>> This is originally an offshoot of the folio work by Matthew. One of the more
>>> complex parts of the struct page definition are the parts used by the slab
>>> allocators. It would be good for the MM in general if struct slab were its own
>>> data type, and it also helps to prevent tail pages from slipping in anywhere.
>>> As Matthew requested in his proof of concept series, I have taken over the
>>> development of this series, so it's a mix of patches from him (often modified
>>> by me) and my own.
>>>
>>> One big difference is the use of coccinelle to perform the relatively trivial
>>> parts of the conversions automatically and at once, instead of a larger number
>>> of smaller incremental reviewable steps. Thanks to Julia Lawall and Luis
>>> Chamberlain for all their help!
>>>
>>> Another notable difference is (based also on review feedback) I don't represent
>>> with a struct slab the large kmalloc allocations which are not really a slab,
>>> but use page allocator directly. When going from an object address to a struct
>>> slab, the code tests first folio slab flag, and only if it's set it converts to
>>> struct slab. This makes the struct slab type stronger.
>>>
>>> Finally, although Matthew's version didn't use any of the folio work, the
>>> initial support has been merged meanwhile so my version builds on top of it
>>> where appropriate. This eliminates some of the redundant compound_head()
>>> being performed e.g. when testing the slab flag.
>>>
>>> To sum up, after this series, struct page fields used by slab allocators are
>>> moved from struct page to a new struct slab, that uses the same physical
>>> storage. The availability of the fields is further distinguished by the
>>> selected slab allocator implementation. The advantages include:
>>>
>>> - Similar to folios, if the slab is of order > 0, struct slab always is
>>>   guaranteed to be the head page. Additionally it's guaranteed to be an actual
>>>   slab page, not a large kmalloc. This removes uncertainty and potential for
>>>   bugs.
>>> - It's not possible to accidentally use fields of the slab implementation that's
>>>   not configured.
>>> - Other subsystems cannot use slab's fields in struct page anymore (some
>>>   existing non-slab usages had to be adjusted in this series), so slab
>>>   implementations have more freedom in rearranging them in the struct slab.
>>>
>>> Matthew Wilcox (Oracle) (16):
>>>   mm: Split slab into its own type
>>>   mm: Add account_slab() and unaccount_slab()
>>>   mm: Convert virt_to_cache() to use struct slab
>>>   mm: Convert __ksize() to struct slab
>>>   mm: Use struct slab in kmem_obj_info()
>>>   mm: Convert check_heap_object() to use struct slab
>>>   mm/slub: Convert detached_freelist to use a struct slab
>>>   mm/slub: Convert kfree() to use a struct slab
>>>   mm/slub: Convert print_page_info() to print_slab_info()
>>>   mm/slub: Convert pfmemalloc_match() to take a struct slab
>>>   mm/slob: Convert SLOB to use struct slab
>>>   mm/kasan: Convert to struct folio and struct slab
>>>   zsmalloc: Stop using slab fields in struct page
>>>   bootmem: Use page->index instead of page->freelist
>>>   iommu: Use put_pages_list
>>>   mm: Remove slab from struct page
>>>
>>> Vlastimil Babka (17):
>>>   mm: add virt_to_folio() and folio_address()
>>>   mm/slab: Dissolve slab_map_pages() in its caller
>>>   mm/slub: Make object_err() static
>>>   mm/slub: Convert __slab_lock() and __slab_unlock() to struct slab
>>>   mm/slub: Convert alloc_slab_page() to return a struct slab
>>>   mm/slub: Convert __free_slab() to use struct slab
>>>   mm/slub: Convert most struct page to struct slab by spatch
>>>   mm/slub: Finish struct page to struct slab conversion
>>>   mm/slab: Convert kmem_getpages() and kmem_freepages() to struct slab
>>>   mm/slab: Convert most struct page to struct slab by spatch
>>>   mm/slab: Finish struct page to struct slab conversion
>>>   mm: Convert struct page to struct slab in functions used by other
>>>     subsystems
>>>   mm/memcg: Convert slab objcgs from struct page to struct slab
>>>   mm/kfence: Convert kfence_guarded_alloc() to struct slab
>>>   mm/sl*b: Differentiate struct slab fields by sl*b implementations
>>>   mm/slub: Simplify struct slab slabs field definition
>>>   mm/slub: Define struct slab fields for CONFIG_SLUB_CPU_PARTIAL only
>>>     when enabled
>>>
>>>  arch/x86/mm/init_64.c          |    2 +-
>>>  drivers/iommu/amd/io_pgtable.c |   59 +-
>>>  drivers/iommu/dma-iommu.c      |   11 +-
>>>  drivers/iommu/intel/iommu.c    |   89 +--
>>>  include/linux/bootmem_info.h   |    2 +-
>>>  include/linux/iommu.h          |    3 +-
>>>  include/linux/kasan.h          |    9 +-
>>>  include/linux/memcontrol.h     |   48 --
>>>  include/linux/mm.h             |   12 +
>>>  include/linux/mm_types.h       |   38 +-
>>>  include/linux/page-flags.h     |   37 -
>>>  include/linux/slab.h           |    8 -
>>>  include/linux/slab_def.h       |   16 +-
>>>  include/linux/slub_def.h       |   29 +-
>>>  mm/bootmem_info.c              |    7 +-
>>>  mm/kasan/common.c              |   27 +-
>>>  mm/kasan/generic.c             |    8 +-
>>>  mm/kasan/kasan.h               |    1 +
>>>  mm/kasan/quarantine.c          |    2 +-
>>>  mm/kasan/report.c              |   13 +-
>>>  mm/kasan/report_tags.c         |   10 +-
>>>  mm/kfence/core.c               |   17 +-
>>>  mm/kfence/kfence_test.c        |    6 +-
>>>  mm/memcontrol.c                |   43 +-
>>>  mm/slab.c                      |  455 ++++++-------
>>>  mm/slab.h                      |  322 ++++++++-
>>>  mm/slab_common.c               |    8 +-
>>>  mm/slob.c                      |   46 +-
>>>  mm/slub.c                      | 1164 ++++++++++++++++----------------
>>>  mm/sparse.c                    |    2 +-
>>>  mm/usercopy.c                  |   13 +-
>>>  mm/zsmalloc.c                  |   18 +-
>>>  32 files changed, 1317 insertions(+), 1208 deletions(-)
>>>
>> 
> 
> 



  reply	other threads:[~2021-12-02 16:37 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 18:14 [PATCH v2 00/33] Separate struct slab from struct page Vlastimil Babka
2021-12-01 18:14 ` Vlastimil Babka
2021-12-01 18:14 ` Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 01/33] mm: add virt_to_folio() and folio_address() Vlastimil Babka
2021-12-14 14:20   ` Johannes Weiner
2021-12-14 14:27     ` Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 02/33] mm/slab: Dissolve slab_map_pages() in its caller Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 03/33] mm/slub: Make object_err() static Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 04/33] mm: Split slab into its own type Vlastimil Babka
2021-12-14 14:24   ` Johannes Weiner
2021-12-01 18:14 ` [PATCH v2 05/33] mm: Add account_slab() and unaccount_slab() Vlastimil Babka
2021-12-14 14:25   ` Johannes Weiner
2021-12-01 18:14 ` [PATCH v2 06/33] mm: Convert virt_to_cache() to use struct slab Vlastimil Babka
2021-12-14 14:26   ` Johannes Weiner
2021-12-01 18:14 ` [PATCH v2 07/33] mm: Convert __ksize() to " Vlastimil Babka
2021-12-14 14:28   ` Johannes Weiner
2021-12-01 18:14 ` [PATCH v2 08/33] mm: Use struct slab in kmem_obj_info() Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 09/33] mm: Convert check_heap_object() to use struct slab Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 10/33] mm/slub: Convert detached_freelist to use a " Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 11/33] mm/slub: Convert kfree() " Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 12/33] mm/slub: Convert __slab_lock() and __slab_unlock() to " Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 13/33] mm/slub: Convert print_page_info() to print_slab_info() Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 14/33] mm/slub: Convert alloc_slab_page() to return a struct slab Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 15/33] mm/slub: Convert __free_slab() to use " Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 16/33] mm/slub: Convert pfmemalloc_match() to take a " Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 17/33] mm/slub: Convert most struct page to struct slab by spatch Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 18/33] mm/slub: Finish struct page to struct slab conversion Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 19/33] mm/slab: Convert kmem_getpages() and kmem_freepages() to struct slab Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 20/33] mm/slab: Convert most struct page to struct slab by spatch Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 21/33] mm/slab: Finish struct page to struct slab conversion Vlastimil Babka
2021-12-01 18:14 ` [PATCH v2 22/33] mm: Convert struct page to struct slab in functions used by other subsystems Vlastimil Babka
2021-12-01 18:14   ` Vlastimil Babka
2021-12-02 17:16   ` Andrey Konovalov
2021-12-02 17:16     ` Andrey Konovalov
2021-12-14 14:31   ` Johannes Weiner
2021-12-14 14:31     ` Johannes Weiner
2021-12-01 18:15 ` [PATCH v2 23/33] mm/memcg: Convert slab objcgs from struct page to struct slab Vlastimil Babka
2021-12-01 18:15   ` Vlastimil Babka
2021-12-14 14:43   ` Johannes Weiner
2021-12-14 14:43     ` Johannes Weiner
2021-12-20 23:31     ` Vlastimil Babka
2021-12-20 23:31       ` Vlastimil Babka
2021-12-01 18:15 ` [PATCH v2 24/33] mm/slob: Convert SLOB to use " Vlastimil Babka
2021-12-10 10:44   ` Hyeonggon Yoo
2021-12-10 11:44     ` Vlastimil Babka
2021-12-10 15:29       ` Hyeonggon Yoo
2021-12-10 18:09         ` Vlastimil Babka
2021-12-11 10:54           ` Hyeonggon Yoo
2021-12-01 18:15 ` [PATCH v2 25/33] mm/kasan: Convert to struct folio and " Vlastimil Babka
2021-12-02 17:16   ` Andrey Konovalov
2021-12-01 18:15 ` [PATCH v2 26/33] mm/kfence: Convert kfence_guarded_alloc() to " Vlastimil Babka
2021-12-01 18:15 ` [PATCH v2 27/33] zsmalloc: Stop using slab fields in struct page Vlastimil Babka
2021-12-01 23:34   ` Minchan Kim
2021-12-14 14:58   ` Johannes Weiner
2021-12-01 18:15 ` [PATCH v2 28/33] bootmem: Use page->index instead of page->freelist Vlastimil Babka
2021-12-14 14:59   ` Johannes Weiner
2021-12-01 18:15 ` [PATCH v2 29/33] iommu: Use put_pages_list Vlastimil Babka
2021-12-01 18:15   ` Vlastimil Babka
2021-12-01 19:07   ` Matthew Wilcox
2021-12-01 19:07     ` Matthew Wilcox
2021-12-01 19:45     ` Robin Murphy
2021-12-01 19:45       ` Robin Murphy
2021-12-01 18:15 ` [PATCH v2 30/33] mm: Remove slab from struct page Vlastimil Babka
2021-12-14 14:46   ` Johannes Weiner
2021-12-01 18:15 ` [PATCH v2 31/33] mm/sl*b: Differentiate struct slab fields by sl*b implementations Vlastimil Babka
2021-12-10 16:37   ` Hyeonggon Yoo
2021-12-10 18:26     ` Vlastimil Babka
2021-12-11 11:55       ` Hyeonggon Yoo
2021-12-11 16:52         ` Matthew Wilcox
2021-12-12  5:54           ` Hyeonggon Yoo
2021-12-11 16:23       ` Matthew Wilcox
2021-12-12  6:00         ` Hyeonggon Yoo
2021-12-12  6:52   ` [PATCH] mm/slob: Remove unnecessary page_mapcount_reset() function call Hyeonggon Yoo
2021-12-14 11:51     ` Vlastimil Babka
2021-12-01 18:15 ` [PATCH v2 32/33] mm/slub: Simplify struct slab slabs field definition Vlastimil Babka
2021-12-14 15:06   ` Johannes Weiner
2021-12-01 18:15 ` [PATCH v2 33/33] mm/slub: Define struct slab fields for CONFIG_SLUB_CPU_PARTIAL only when enabled Vlastimil Babka
2021-12-01 18:39 ` slab tree for next Vlastimil Babka
2021-12-01 20:34   ` Vlastimil Babka
2021-12-02 16:36     ` Vlastimil Babka [this message]
2021-12-02 20:39       ` Stephen Rothwell
2022-01-04  0:21   ` Vlastimil Babka
2022-01-04  8:44     ` Stephen Rothwell
2023-08-29  9:55     ` Vlastimil Babka
2023-08-29 21:33       ` Stephen Rothwell
2021-12-02 12:25 ` [PATCH v2 00/33] Separate struct slab from struct page Vlastimil Babka
2021-12-02 12:25   ` Vlastimil Babka
2021-12-02 12:25   ` Vlastimil Babka
2021-12-14 12:57 ` Vlastimil Babka
2021-12-14 12:57   ` Vlastimil Babka
2021-12-14 12:57   ` Vlastimil Babka
2021-12-14 14:38   ` Hyeonggon Yoo
2021-12-14 14:38     ` Hyeonggon Yoo
2021-12-14 14:38     ` Hyeonggon Yoo
2021-12-14 14:43     ` Vlastimil Babka
2021-12-14 14:43       ` Vlastimil Babka
2021-12-14 14:43       ` Vlastimil Babka
2021-12-15  3:47       ` Hyeonggon Yoo
2021-12-15  3:47         ` Hyeonggon Yoo
2021-12-15  3:47         ` Hyeonggon Yoo
2021-12-15  1:03   ` Roman Gushchin
2021-12-15  1:03     ` Roman Gushchin via iommu
2021-12-15  1:03     ` Roman Gushchin via iommu
2021-12-15 23:38     ` Roman Gushchin
2021-12-15 23:38       ` Roman Gushchin
2021-12-15 23:38       ` Roman Gushchin via iommu
2021-12-16  9:19       ` Vlastimil Babka
2021-12-16  9:19         ` Vlastimil Babka
2021-12-16  9:19         ` Vlastimil Babka
2021-12-20  0:47       ` Vlastimil Babka
2021-12-20  0:47         ` Vlastimil Babka
2021-12-20  0:47         ` Vlastimil Babka
2021-12-20  1:42         ` Matthew Wilcox
2021-12-20  1:42           ` Matthew Wilcox
2021-12-20  1:42           ` Matthew Wilcox
2021-12-20  0:24     ` Vlastimil Babka
2021-12-20  0:24       ` Vlastimil Babka
2021-12-20  0:24       ` Vlastimil Babka
2021-12-16 15:00   ` Hyeonggon Yoo
2021-12-16 15:00     ` Hyeonggon Yoo
2021-12-16 15:00     ` Hyeonggon Yoo
2021-12-20 23:58     ` Vlastimil Babka
2021-12-20 23:58       ` Vlastimil Babka
2021-12-20 23:58       ` Vlastimil Babka
2021-12-21 17:25       ` Robin Murphy
2021-12-21 17:25         ` Robin Murphy
2021-12-21 17:25         ` Robin Murphy
2021-12-22  7:36       ` Hyeonggon Yoo
2021-12-22  7:36         ` Hyeonggon Yoo
2021-12-22  7:36         ` Hyeonggon Yoo
2021-12-22 16:56   ` Vlastimil Babka
2021-12-22 16:56     ` Vlastimil Babka
2021-12-22 16:56     ` Vlastimil Babka
2021-12-25  9:16     ` Hyeonggon Yoo
2021-12-25  9:16       ` Hyeonggon Yoo
2021-12-25  9:16       ` Hyeonggon Yoo
2021-12-25 17:53       ` Matthew Wilcox
2021-12-25 17:53         ` Matthew Wilcox
2021-12-25 17:53         ` Matthew Wilcox
2021-12-27  2:43         ` Hyeonggon Yoo
2021-12-27  2:43           ` Hyeonggon Yoo
2021-12-27  2:43           ` Hyeonggon Yoo
2021-12-29 11:22     ` Hyeonggon Yoo
2021-12-29 11:22       ` Hyeonggon Yoo
2021-12-29 11:22       ` Hyeonggon Yoo
2022-01-03 17:56       ` Vlastimil Babka
2022-01-03 17:56         ` Vlastimil Babka
2022-01-03 17:56         ` Vlastimil Babka

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=87d57688-cdcc-07c5-d63d-397806e7ed03@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=robin.murphy@arm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.