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: <ZUznNn42H5vRUF0r@casper.infradead.org>
Date:   Thu, 9 Nov 2023 14:05:42 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Jeff Xie <jeff.xie@...ux.dev>
Cc:     akpm@...ux-foundation.org, iamjoonsoo.kim@....com, vbabka@...e.cz,
        cl@...ux.com, penberg@...nel.org, rientjes@...gle.com,
        roman.gushchin@...ux.dev, 42.hyeyoo@...il.com, linux-mm@...ck.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        chensong_2000@....cn, xiehuan09@...il.com
Subject: Re: [RFC][PATCH 2/4] mm, slub: implement slub allocate post callback
 for page_owner

On Thu, Nov 09, 2023 at 11:25:19AM +0800, Jeff Xie wrote:
> +#ifdef CONFIG_PAGE_OWNER
> +static int slab_alloc_post_page_owner(struct folio *folio, struct task_struct *tsk,
> +			void *data, char *kbuf, size_t count)
> +{
> +	int ret;
> +	struct kmem_cache *kmem_cache = data;
> +
> +	ret = scnprintf(kbuf, count, "SLAB_PAGE slab_name:%s\n", kmem_cache->name);
> +
> +	return ret;
> +}
> +#endif

Or we could do this typesafely ...

	struct slab *slab = folio_slab(folio);
	struct kmem_cache *kmem_cache = slab->slab_cache;

... and then there's no need to pass in a 'data' to the function.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ