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: <Yw2E937l+GARR3Vb@casper.infradead.org>
Date:   Tue, 30 Aug 2022 04:33:11 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, songmuchun@...edance.com,
        mike.kravetz@...cle.com, vbabka@...e.cz,
        william.kucharski@...cle.com, dhowells@...hat.com,
        peterx@...hat.com, arnd@...db.de, ccross@...gle.com,
        hughd@...gle.com, ebiederm@...ssion.com
Subject: Re: [PATCH 1/7] mm/hugetlb: add folio support to hugetlb specific
 flag macros

On Mon, Aug 29, 2022 at 04:00:08PM -0700, Sidhartha Kumar wrote:
>  #define TESTHPAGEFLAG(uname, flname)				\
> +static __always_inline								\
> +int folio_test_hugetlb_##flname(struct folio *folio)		\

One change I made was to have folio_test_foo() return bool instead of
int.  It helps the compiler really understand what's going on.  Maybe
some humans too ;-)

> +	{	void **private = &folio->private;		\
> +		return test_bit(HPG_##flname, (void *)((unsigned long)private));	\

I've made this tricky for you by making folio->private a void * instead
of the unsigned long in page.  Would this look better as ...

	{							\
		void *private = &folio->private;		\
		return test_bit(HPG_##flname, private);		\

perhaps?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ