linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Do we still need SLAB_MEM_SPREAD (and possibly others)?
@ 2024-01-31 22:20 Steven Rostedt
  2024-01-31 22:25 ` Yosry Ahmed
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2024-01-31 22:20 UTC (permalink / raw)
  To: LKML, linux-mm
  Cc: Andrew Morton, Linus Torvalds, Vlastimil Babka, Kees Cook,
	Christoph Lameter, David Rientjes, Hyeonggon Yoo

I was looking into moving eventfs_inode into a slab, and after cutting and
pasting the tracefs allocator:

	tracefs_inode_cachep = kmem_cache_create("tracefs_inode_cache",
						 sizeof(struct tracefs_inode),
						 0, (SLAB_RECLAIM_ACCOUNT|
						     SLAB_MEM_SPREAD|
						     SLAB_ACCOUNT),
						 init_once);

I figured I should know what those slab flags mean. I also looked at what
others in fs use for their slabs. The above is rather common (which I
probably just copied from another file system), but I wanted to know what
they are for.

When I got to SLAB_MEM_SPREAD, I found that it's a common flag and there's
a lot of caches that just set that and nothing else.

But I couldn't find how it was used.

Then I found this commit:

 16a1d968358a ("mm/slab: remove mm/slab.c and slab_def.h")

Which I think removed the only use case of SLAB_MEM_SPREAD.

 $ git grep SLAB_MEM_SPREAD mm
mm/slab.h:                            SLAB_MEM_SPREAD | \

That's all I find in the mm directory.

Is it obsolete now? Can we delete it? Maybe there's other SLAB_* flags that
are no longer used. I don't know, I haven't audited them.

-- Steve


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-01-31 22:20 Do we still need SLAB_MEM_SPREAD (and possibly others)? Steven Rostedt
@ 2024-01-31 22:25 ` Yosry Ahmed
  2024-01-31 22:40   ` Vlastimil Babka
  0 siblings, 1 reply; 10+ messages in thread
From: Yosry Ahmed @ 2024-01-31 22:25 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, linux-mm, Andrew Morton, Linus Torvalds, Vlastimil Babka,
	Kees Cook, Christoph Lameter, David Rientjes, Hyeonggon Yoo

On Wed, Jan 31, 2024 at 2:20 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> I was looking into moving eventfs_inode into a slab, and after cutting and
> pasting the tracefs allocator:
>
>         tracefs_inode_cachep = kmem_cache_create("tracefs_inode_cache",
>                                                  sizeof(struct tracefs_inode),
>                                                  0, (SLAB_RECLAIM_ACCOUNT|
>                                                      SLAB_MEM_SPREAD|
>                                                      SLAB_ACCOUNT),
>                                                  init_once);
>
> I figured I should know what those slab flags mean. I also looked at what
> others in fs use for their slabs. The above is rather common (which I
> probably just copied from another file system), but I wanted to know what
> they are for.
>
> When I got to SLAB_MEM_SPREAD, I found that it's a common flag and there's
> a lot of caches that just set that and nothing else.
>
> But I couldn't find how it was used.
>
> Then I found this commit:
>
>  16a1d968358a ("mm/slab: remove mm/slab.c and slab_def.h")
>
> Which I think removed the only use case of SLAB_MEM_SPREAD.
>
>  $ git grep SLAB_MEM_SPREAD mm
> mm/slab.h:                            SLAB_MEM_SPREAD | \
>
> That's all I find in the mm directory.
>
> Is it obsolete now? Can we delete it? Maybe there's other SLAB_* flags that
> are no longer used. I don't know, I haven't audited them.

Perhaps cpuset_do_slab_mem_spread() as well.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-01-31 22:25 ` Yosry Ahmed
@ 2024-01-31 22:40   ` Vlastimil Babka
  2024-02-01  6:27     ` Chengming Zhou
  0 siblings, 1 reply; 10+ messages in thread
From: Vlastimil Babka @ 2024-01-31 22:40 UTC (permalink / raw)
  To: Yosry Ahmed, Steven Rostedt
  Cc: LKML, linux-mm, Andrew Morton, Linus Torvalds, Kees Cook,
	Christoph Lameter, David Rientjes, Hyeonggon Yoo, Xiongwei Song,
	Chengming Zhou, Zheng Yejian

On 1/31/24 23:25, Yosry Ahmed wrote:
> On Wed, Jan 31, 2024 at 2:20 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>>
>> I was looking into moving eventfs_inode into a slab, and after cutting and
>> pasting the tracefs allocator:
>>
>>         tracefs_inode_cachep = kmem_cache_create("tracefs_inode_cache",
>>                                                  sizeof(struct tracefs_inode),
>>                                                  0, (SLAB_RECLAIM_ACCOUNT|
>>                                                      SLAB_MEM_SPREAD|
>>                                                      SLAB_ACCOUNT),
>>                                                  init_once);
>>
>> I figured I should know what those slab flags mean. I also looked at what
>> others in fs use for their slabs. The above is rather common (which I
>> probably just copied from another file system), but I wanted to know what
>> they are for.
>>
>> When I got to SLAB_MEM_SPREAD, I found that it's a common flag and there's
>> a lot of caches that just set that and nothing else.
>>
>> But I couldn't find how it was used.
>>
>> Then I found this commit:
>>
>>  16a1d968358a ("mm/slab: remove mm/slab.c and slab_def.h")
>>
>> Which I think removed the only use case of SLAB_MEM_SPREAD.
>>
>>  $ git grep SLAB_MEM_SPREAD mm
>> mm/slab.h:                            SLAB_MEM_SPREAD | \
>>
>> That's all I find in the mm directory.
>>
>> Is it obsolete now? Can we delete it? Maybe there's other SLAB_* flags that
>> are no longer used. I don't know, I haven't audited them.
> 
> Perhaps cpuset_do_slab_mem_spread() as well.

Yep, good find. Show how obscure mm/slab.c was in the end :)

CCing a few more new people who did slab changes recently, who'd like some
low hanging fruit of negative diffcount? :)

Thanks,
Vlastimil


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-01-31 22:40   ` Vlastimil Babka
@ 2024-02-01  6:27     ` Chengming Zhou
  2024-02-04  2:06       ` Song, Xiongwei
  0 siblings, 1 reply; 10+ messages in thread
From: Chengming Zhou @ 2024-02-01  6:27 UTC (permalink / raw)
  To: Vlastimil Babka, Yosry Ahmed, Steven Rostedt
  Cc: LKML, linux-mm, Andrew Morton, Linus Torvalds, Kees Cook,
	Christoph Lameter, David Rientjes, Hyeonggon Yoo, Xiongwei Song,
	Chengming Zhou, Zheng Yejian

On 2024/2/1 06:40, Vlastimil Babka wrote:
> On 1/31/24 23:25, Yosry Ahmed wrote:
>> On Wed, Jan 31, 2024 at 2:20 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>>>
>>> I was looking into moving eventfs_inode into a slab, and after cutting and
>>> pasting the tracefs allocator:
>>>
>>>         tracefs_inode_cachep = kmem_cache_create("tracefs_inode_cache",
>>>                                                  sizeof(struct tracefs_inode),
>>>                                                  0, (SLAB_RECLAIM_ACCOUNT|
>>>                                                      SLAB_MEM_SPREAD|
>>>                                                      SLAB_ACCOUNT),
>>>                                                  init_once);
>>>
>>> I figured I should know what those slab flags mean. I also looked at what
>>> others in fs use for their slabs. The above is rather common (which I
>>> probably just copied from another file system), but I wanted to know what
>>> they are for.
>>>
>>> When I got to SLAB_MEM_SPREAD, I found that it's a common flag and there's
>>> a lot of caches that just set that and nothing else.
>>>
>>> But I couldn't find how it was used.
>>>
>>> Then I found this commit:
>>>
>>>  16a1d968358a ("mm/slab: remove mm/slab.c and slab_def.h")
>>>
>>> Which I think removed the only use case of SLAB_MEM_SPREAD.
>>>
>>>  $ git grep SLAB_MEM_SPREAD mm
>>> mm/slab.h:                            SLAB_MEM_SPREAD | \
>>>
>>> That's all I find in the mm directory.
>>>
>>> Is it obsolete now? Can we delete it? Maybe there's other SLAB_* flags that
>>> are no longer used. I don't know, I haven't audited them.
>>
>> Perhaps cpuset_do_slab_mem_spread() as well.
> 
> Yep, good find. Show how obscure mm/slab.c was in the end :)
> 
> CCing a few more new people who did slab changes recently, who'd like some
> low hanging fruit of negative diffcount? :)

Thanks for CCing, I can prepare the patch to do it. IIUC, what I need to do is:

1. delete SLAB_MEM_SPREAD and all its uses.

2. cpuset_do_slab_mem_spread() is not used anymore, should we keep the interface?
   Since it's the interface exported by cgroup-v1 "cpuset.memory_spread_slab".



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-02-01  6:27     ` Chengming Zhou
@ 2024-02-04  2:06       ` Song, Xiongwei
  2024-02-05 17:50         ` Christoph Lameter (Ampere)
  0 siblings, 1 reply; 10+ messages in thread
From: Song, Xiongwei @ 2024-02-04  2:06 UTC (permalink / raw)
  To: Chengming Zhou, Vlastimil Babka, Yosry Ahmed, Steven Rostedt
  Cc: LKML, linux-mm, Andrew Morton, Linus Torvalds, Kees Cook,
	Christoph Lameter, David Rientjes, Hyeonggon Yoo, Chengming Zhou,
	Zheng Yejian



> -----Original Message-----
> From: Chengming Zhou <chengming.zhou@linux.dev>
> Sent: Thursday, February 1, 2024 2:27 PM
> To: Vlastimil Babka <vbabka@suse.cz>; Yosry Ahmed
> <yosryahmed@google.com>; Steven Rostedt <rostedt@goodmis.org>
> Cc: LKML <linux-kernel@vger.kernel.org>; linux-mm@kvack.org; Andrew
> Morton <akpm@linux-foundation.org>; Linus Torvalds <torvalds@linux-
> foundation.org>; Kees Cook <keescook@chromium.org>; Christoph Lameter
> <cl@linux.com>; David Rientjes <rientjes@google.com>; Hyeonggon Yoo
> <42.hyeyoo@gmail.com>; Song, Xiongwei <Xiongwei.Song@windriver.com>;
> Chengming Zhou <zhouchengming@bytedance.com>; Zheng Yejian
> <zhengyejian1@huawei.com>
> Subject: Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
> 
> 
> On 2024/2/1 06:40, Vlastimil Babka wrote:
> > On 1/31/24 23:25, Yosry Ahmed wrote:
> >> On Wed, Jan 31, 2024 at 2:20 PM Steven Rostedt <rostedt@goodmis.org>
> wrote:
> >>>
> >>> I was looking into moving eventfs_inode into a slab, and after cutting and
> >>> pasting the tracefs allocator:
> >>>
> >>>         tracefs_inode_cachep = kmem_cache_create("tracefs_inode_cache",
> >>>                                                  sizeof(struct tracefs_inode),
> >>>                                                  0, (SLAB_RECLAIM_ACCOUNT|
> >>>                                                      SLAB_MEM_SPREAD|
> >>>                                                      SLAB_ACCOUNT),
> >>>                                                  init_once);
> >>>
> >>> I figured I should know what those slab flags mean. I also looked at what
> >>> others in fs use for their slabs. The above is rather common (which I
> >>> probably just copied from another file system), but I wanted to know
> what
> >>> they are for.
> >>>
> >>> When I got to SLAB_MEM_SPREAD, I found that it's a common flag and
> there's
> >>> a lot of caches that just set that and nothing else.
> >>>
> >>> But I couldn't find how it was used.
> >>>
> >>> Then I found this commit:
> >>>
> >>>  16a1d968358a ("mm/slab: remove mm/slab.c and slab_def.h")
> >>>
> >>> Which I think removed the only use case of SLAB_MEM_SPREAD.
> >>>
> >>>  $ git grep SLAB_MEM_SPREAD mm
> >>> mm/slab.h:                            SLAB_MEM_SPREAD | \
> >>>
> >>> That's all I find in the mm directory.
> >>>
> >>> Is it obsolete now? Can we delete it? Maybe there's other SLAB_* flags
> that
> >>> are no longer used. I don't know, I haven't audited them.
> >>
> >> Perhaps cpuset_do_slab_mem_spread() as well.
> >
> > Yep, good find. Show how obscure mm/slab.c was in the end :)
> >
> > CCing a few more new people who did slab changes recently, who'd like
> some
> > low hanging fruit of negative diffcount? :)
> 
> Thanks for CCing, I can prepare the patch to do it. IIUC, what I need to do is:
> 
> 1. delete SLAB_MEM_SPREAD and all its uses.
> 
> 2. cpuset_do_slab_mem_spread() is not used anymore, should we keep the
> interface?
>    Since it's the interface exported by cgroup-v1
> "cpuset.memory_spread_slab".

Once SLAB_MEM_SPREAD is removed, IMO, cpuset.memory_spread_slab is useless.

Regards,
Xiongwei


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-02-04  2:06       ` Song, Xiongwei
@ 2024-02-05 17:50         ` Christoph Lameter (Ampere)
       [not found]           ` <PH0PR11MB5192FC6A7AA3CB84BA3BC7E6EC462@PH0PR11MB5192.namprd11.prod.outlook.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Lameter (Ampere) @ 2024-02-05 17:50 UTC (permalink / raw)
  To: Song, Xiongwei
  Cc: Chengming Zhou, Vlastimil Babka, Yosry Ahmed, Steven Rostedt,
	LKML, linux-mm, Andrew Morton, Linus Torvalds, Kees Cook,
	David Rientjes, Hyeonggon Yoo, Chengming Zhou, Zheng Yejian

On Sun, 4 Feb 2024, Song, Xiongwei wrote:

> Once SLAB_MEM_SPREAD is removed, IMO, cpuset.memory_spread_slab is useless.

SLAB_MEM_SPREAD does not do anything anymore. SLUB relies on the 
"spreading" via the page allocator memory policies instead of doing its 
own like SLAB used to do.

What does FILE_SPREAD_SLAB do? Dont see anything there either.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
       [not found]           ` <PH0PR11MB5192FC6A7AA3CB84BA3BC7E6EC462@PH0PR11MB5192.namprd11.prod.outlook.com>
@ 2024-02-06  3:16             ` Waiman Long
  2024-02-06  3:20               ` Waiman Long
  0 siblings, 1 reply; 10+ messages in thread
From: Waiman Long @ 2024-02-06  3:16 UTC (permalink / raw)
  To: Song, Xiongwei, Christoph Lameter (Ampere), Zefan Li
  Cc: Chengming Zhou, Vlastimil Babka, Yosry Ahmed, Steven Rostedt,
	LKML, linux-mm, Andrew Morton, Linus Torvalds, Kees Cook,
	David Rientjes, Hyeonggon Yoo, Chengming Zhou, Zheng Yejian,
	cgroups


On 2/5/24 20:46, Song, Xiongwei wrote:
> Adding the maintainers of cpuset of cgroup.
>
>> On Sun, 4 Feb 2024, Song, Xiongwei wrote:
>>
>>> Once SLAB_MEM_SPREAD is removed, IMO, cpuset.memory_spread_slab is useless.
>> SLAB_MEM_SPREAD does not do anything anymore. SLUB relies on the
>> "spreading" via the page allocator memory policies instead of doing its
>> own like SLAB used to do.
>>
>> What does FILE_SPREAD_SLAB do? Dont see anything there either.
> The FILE_SPREAD_SLAB flag is used by cpuset.memory_spread_slab with read/write operations:
>
> In kernel/cgroup/cpuset.c,
> static struct cftype legacy_files[] = {
> ... snip ...
>          {
>                  .name = "memory_spread_slab",
>                  .read_u64 = cpuset_read_u64,
>                  .write_u64 = cpuset_write_u64,
>                  .private = FILE_SPREAD_SLAB,
>          },
> ... snip ...
> };

It looks like that memory_spread_slab may have effect only on the slab 
allocator. With the removal of the slab allocator, memory_spread_slab is 
now a no-op. However, the memory_spread_slab cgroupfs file is an 
externally visible API. So we can't just remove it as it may break 
existing applications. We can certainly deprecate it and advise users 
not to use it.

Cheers,
Longman




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-02-06  3:16             ` Waiman Long
@ 2024-02-06  3:20               ` Waiman Long
  2024-02-06  3:25                 ` Chengming Zhou
  0 siblings, 1 reply; 10+ messages in thread
From: Waiman Long @ 2024-02-06  3:20 UTC (permalink / raw)
  To: Song, Xiongwei, Christoph Lameter (Ampere), Zefan Li
  Cc: Chengming Zhou, Vlastimil Babka, Yosry Ahmed, Steven Rostedt,
	LKML, linux-mm, Andrew Morton, Linus Torvalds, Kees Cook,
	David Rientjes, Hyeonggon Yoo, Chengming Zhou, Zheng Yejian,
	cgroups


On 2/5/24 22:16, Waiman Long wrote:
>
> On 2/5/24 20:46, Song, Xiongwei wrote:
>> Adding the maintainers of cpuset of cgroup.
>>
>>> On Sun, 4 Feb 2024, Song, Xiongwei wrote:
>>>
>>>> Once SLAB_MEM_SPREAD is removed, IMO, cpuset.memory_spread_slab is 
>>>> useless.
>>> SLAB_MEM_SPREAD does not do anything anymore. SLUB relies on the
>>> "spreading" via the page allocator memory policies instead of doing its
>>> own like SLAB used to do.
>>>
>>> What does FILE_SPREAD_SLAB do? Dont see anything there either.
>> The FILE_SPREAD_SLAB flag is used by cpuset.memory_spread_slab with 
>> read/write operations:
>>
>> In kernel/cgroup/cpuset.c,
>> static struct cftype legacy_files[] = {
>> ... snip ...
>>          {
>>                  .name = "memory_spread_slab",
>>                  .read_u64 = cpuset_read_u64,
>>                  .write_u64 = cpuset_write_u64,
>>                  .private = FILE_SPREAD_SLAB,
>>          },
>> ... snip ...
>> };
>
> It looks like that memory_spread_slab may have effect only on the slab 
> allocator. With the removal of the slab allocator, memory_spread_slab 
> is now a no-op. However, the memory_spread_slab cgroupfs file is an 
> externally visible API. So we can't just remove it as it may break 
> existing applications. We can certainly deprecate it and advise users 
> not to use it.

BTW, cpuset doesn't use SLAB_MEM_SPREAD directly. Instead it set the 
task's PFA_SPREAD_SLAB and let other subsystems test it to act 
appropriately. Other than cpuset, the latest upstream kernel doesn't 
check or use this flag at all.

Cheers,
Longman



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-02-06  3:20               ` Waiman Long
@ 2024-02-06  3:25                 ` Chengming Zhou
  2024-02-06  3:34                   ` Waiman Long
  0 siblings, 1 reply; 10+ messages in thread
From: Chengming Zhou @ 2024-02-06  3:25 UTC (permalink / raw)
  To: Waiman Long, Song, Xiongwei, Christoph Lameter (Ampere)
  Cc: Vlastimil Babka, Yosry Ahmed, Steven Rostedt, LKML, linux-mm,
	Andrew Morton, Linus Torvalds, Zefan Li, Kees Cook,
	David Rientjes, Hyeonggon Yoo, Chengming Zhou, Zheng Yejian,
	cgroups

On 2024/2/6 11:20, Waiman Long wrote:
> 
> On 2/5/24 22:16, Waiman Long wrote:
>>
>> On 2/5/24 20:46, Song, Xiongwei wrote:
>>> Adding the maintainers of cpuset of cgroup.
>>>
>>>> On Sun, 4 Feb 2024, Song, Xiongwei wrote:
>>>>
>>>>> Once SLAB_MEM_SPREAD is removed, IMO, cpuset.memory_spread_slab is useless.
>>>> SLAB_MEM_SPREAD does not do anything anymore. SLUB relies on the
>>>> "spreading" via the page allocator memory policies instead of doing its
>>>> own like SLAB used to do.
>>>>
>>>> What does FILE_SPREAD_SLAB do? Dont see anything there either.
>>> The FILE_SPREAD_SLAB flag is used by cpuset.memory_spread_slab with read/write operations:
>>>
>>> In kernel/cgroup/cpuset.c,
>>> static struct cftype legacy_files[] = {
>>> ... snip ...
>>>          {
>>>                  .name = "memory_spread_slab",
>>>                  .read_u64 = cpuset_read_u64,
>>>                  .write_u64 = cpuset_write_u64,
>>>                  .private = FILE_SPREAD_SLAB,
>>>          },
>>> ... snip ...
>>> };
>>
>> It looks like that memory_spread_slab may have effect only on the slab allocator. With the removal of the slab allocator, memory_spread_slab is now a no-op. However, the memory_spread_slab cgroupfs file is an externally visible API. So we can't just remove it as it may break existing applications. We can certainly deprecate it and advise users not to use it.
> 
> BTW, cpuset doesn't use SLAB_MEM_SPREAD directly. Instead it set the task's PFA_SPREAD_SLAB and let other subsystems test it to act appropriately. Other than cpuset, the latest upstream kernel doesn't check or use this flag at all.
> 

Ok, get it. So cpuset_do_slab_mem_spread() can be removed, but
this cpuset file interface and PFA_SPREAD_SLAB will be keeped.

Thanks.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Do we still need SLAB_MEM_SPREAD (and possibly others)?
  2024-02-06  3:25                 ` Chengming Zhou
@ 2024-02-06  3:34                   ` Waiman Long
  0 siblings, 0 replies; 10+ messages in thread
From: Waiman Long @ 2024-02-06  3:34 UTC (permalink / raw)
  To: Chengming Zhou, Song, Xiongwei, Christoph Lameter (Ampere)
  Cc: Vlastimil Babka, Yosry Ahmed, Steven Rostedt, LKML, linux-mm,
	Andrew Morton, Linus Torvalds, Zefan Li, Kees Cook,
	David Rientjes, Hyeonggon Yoo, Chengming Zhou, Zheng Yejian,
	cgroups


On 2/5/24 22:25, Chengming Zhou wrote:
> On 2024/2/6 11:20, Waiman Long wrote:
>> On 2/5/24 22:16, Waiman Long wrote:
>>> On 2/5/24 20:46, Song, Xiongwei wrote:
>>>> Adding the maintainers of cpuset of cgroup.
>>>>
>>>>> On Sun, 4 Feb 2024, Song, Xiongwei wrote:
>>>>>
>>>>>> Once SLAB_MEM_SPREAD is removed, IMO, cpuset.memory_spread_slab is useless.
>>>>> SLAB_MEM_SPREAD does not do anything anymore. SLUB relies on the
>>>>> "spreading" via the page allocator memory policies instead of doing its
>>>>> own like SLAB used to do.
>>>>>
>>>>> What does FILE_SPREAD_SLAB do? Dont see anything there either.
>>>> The FILE_SPREAD_SLAB flag is used by cpuset.memory_spread_slab with read/write operations:
>>>>
>>>> In kernel/cgroup/cpuset.c,
>>>> static struct cftype legacy_files[] = {
>>>> ... snip ...
>>>>           {
>>>>                   .name = "memory_spread_slab",
>>>>                   .read_u64 = cpuset_read_u64,
>>>>                   .write_u64 = cpuset_write_u64,
>>>>                   .private = FILE_SPREAD_SLAB,
>>>>           },
>>>> ... snip ...
>>>> };
>>> It looks like that memory_spread_slab may have effect only on the slab allocator. With the removal of the slab allocator, memory_spread_slab is now a no-op. However, the memory_spread_slab cgroupfs file is an externally visible API. So we can't just remove it as it may break existing applications. We can certainly deprecate it and advise users not to use it.
>> BTW, cpuset doesn't use SLAB_MEM_SPREAD directly. Instead it set the task's PFA_SPREAD_SLAB and let other subsystems test it to act appropriately. Other than cpuset, the latest upstream kernel doesn't check or use this flag at all.
>>
> Ok, get it. So cpuset_do_slab_mem_spread() can be removed, but
> this cpuset file interface and PFA_SPREAD_SLAB will be keeped.

Yes, for now.

Cheers,
Longman



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-02-06  3:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 22:20 Do we still need SLAB_MEM_SPREAD (and possibly others)? Steven Rostedt
2024-01-31 22:25 ` Yosry Ahmed
2024-01-31 22:40   ` Vlastimil Babka
2024-02-01  6:27     ` Chengming Zhou
2024-02-04  2:06       ` Song, Xiongwei
2024-02-05 17:50         ` Christoph Lameter (Ampere)
     [not found]           ` <PH0PR11MB5192FC6A7AA3CB84BA3BC7E6EC462@PH0PR11MB5192.namprd11.prod.outlook.com>
2024-02-06  3:16             ` Waiman Long
2024-02-06  3:20               ` Waiman Long
2024-02-06  3:25                 ` Chengming Zhou
2024-02-06  3:34                   ` Waiman Long

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 NNTP newsgroup(s).