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: <20221121121938.1f202880ffe6bb18160ef785@linux-foundation.org>
Date:   Mon, 21 Nov 2022 12:19:38 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Feng Tang <feng.tang@...el.com>
Cc:     Vlastimil Babka <vbabka@...e.cz>, Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        Hyeonggon Yoo <42.hyeyoo@...il.com>,
        Andrey Konovalov <andreyknvl@...il.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Andrey Ryabinin <ryabinin.a.a@...il.com>,
        Alexander Potapenko <glider@...gle.com>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        linux-mm@...ck.org, kasan-dev@...glegroups.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next 1/2] mm/slab: add is_kmalloc_cache() helper macro

On Mon, 21 Nov 2022 21:50:23 +0800 Feng Tang <feng.tang@...el.com> wrote:

> +#ifndef CONFIG_SLOB
> +#define is_kmalloc_cache(s) ((s)->flags & SLAB_KMALLOC)
> +#else
> +#define is_kmalloc_cache(s) (false)
> +#endif

Could be implemented as a static inline C function, yes?

If so, that's always best.  For (silly) example, consider the behaviour
of

	x = is_kmalloc_cache(s++);

with and without CONFIG_SLOB.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ