lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZTZn23OzQfAm6epp@casper.infradead.org>
Date:   Mon, 23 Oct 2023 13:32:27 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     chengming.zhou@...ux.dev
Cc:     cl@...ux.com, penberg@...nel.org, rientjes@...gle.com,
        iamjoonsoo.kim@....com, akpm@...ux-foundation.org, vbabka@...e.cz,
        roman.gushchin@...ux.dev, 42.hyeyoo@...il.com, pcc@...gle.com,
        tytso@....edu, maz@...nel.org, ruansy.fnst@...itsu.com,
        vishal.moola@...il.com, lrh2000@....edu.cn, hughd@...gle.com,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Chengming Zhou <zhouchengming@...edance.com>
Subject: Re: [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@...ux.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));
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ