lkml.org 
[lkml]   [2023]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC PATCH v2 1/6] slub: Keep track of whether slub is on the per-node partial list
On Sat, Oct 21, 2023 at 02:43:12PM +0000, chengming.zhou@linux.dev wrote:
> +++ b/include/linux/page-flags.h
> @@ -478,6 +478,8 @@ PAGEFLAG(Active, active, PF_HEAD) __CLEARPAGEFLAG(Active, active, PF_HEAD)
> TESTCLEARFLAG(Active, active, PF_HEAD)
> PAGEFLAG(Workingset, workingset, PF_HEAD)
> TESTCLEARFLAG(Workingset, workingset, PF_HEAD)
> + __SETPAGEFLAG(Workingset, workingset, PF_HEAD)
> + __CLEARPAGEFLAG(Workingset, workingset, PF_HEAD)

This makes me nervous. The __ versions can only be used when there are
guaranteed to be no other accesses to the flags. It's never going to
be the case that we want code to call __folio_set_workingset().

_Assuming_ that it's safe to use the non-atomic flag setting, I'd
rather see this done as ...

static inline void slab_set_node_partial(struct slab *slab)
{
__folio_set_workingset(slab_folio(slab));
__set_bit(PG_workingset, folio_flags(slab_folio(slab), 0));
}

\
 
 \ /
  Last update: 2023-10-23 14:34    [W:0.152 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site