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]
Date: Sat, 16 Dec 2023 18:03:36 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Kent Overstreet <kent.overstreet@...ux.dev>,
 Matthew Wilcox <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
 linux-fsdevel@...r.kernel.org, tglx@...utronix.de, x86@...nel.org,
 tj@...nel.org, peterz@...radead.org, mathieu.desnoyers@...icios.com,
 paulmck@...nel.org, keescook@...omium.org, dave.hansen@...ux.intel.com,
 mingo@...hat.com, will@...nel.org, longman@...hat.com, boqun.feng@...il.com,
 brauner@...nel.org
Subject: Re: [PATCH 46/50] preempt.h: Kill dependency on list.h



On 12/16/23 16:20, Kent Overstreet wrote:
> On Sun, Dec 17, 2023 at 12:18:17AM +0000, Matthew Wilcox wrote:
>> On Sat, Dec 16, 2023 at 04:04:43PM -0800, Randy Dunlap wrote:
>>>
>>>
>>> On 12/16/23 14:35, Kent Overstreet wrote:
>>>> On Sat, Dec 16, 2023 at 06:13:41AM +0000, Matthew Wilcox wrote:
>>>>> On Fri, Dec 15, 2023 at 10:35:47PM -0500, Kent Overstreet wrote:
>>>>>> -	INIT_HLIST_NODE(&notifier->link);
>>>>>> +	/* INIT_HLIST_NODE() open coded, to avoid dependency on list.h */
>>>>>> +	notifier->link.next = NULL;
>>>>>> +	notifier->link.pprev = NULL;
>>>>>
>>>>> Arguably INIT_HLIST_NODE() belongs in types.h -- we already have
>>>>> RCUREF_INIT() and ATOMIC_INIT() in there.
>>>>
>>>> I think I'd prefer to keep types.h as minimal as possible - as soon as
>>>> we start putting non type stuff in there people won't know what the
>>>> distinction is and it'll grow.
>>>>
>>>> preempt.h is a bit unusual too, normally we'd just split out a _types.h
>>>> header there but it's not so easy to split up usefully.
>>>>
>>>
>>> I don't feel like I have NAK power, but if I did, I would NAK
>>> open coding of INIT_HLIST_HEAD() or anything like it.
>>> I would expect some $maintainer to do likewise, but I could be
>>> surprised.
>>
>> There is another solution here (although I prefer moving INIT_HLIST_HEAD
>> into types.h).  The preprocessor allows redefinitions as long as the two
>> definitions match exactly.  So you can copy INIT_HLIST_HEAD into
>> preempt.h and if the definition ever changes, we'll notice.
> 
> I like it.

Possible to revert 490d6ab170c9 ? although with something list
this inserted:

	struct hlist_node *_p = h;
and then use _p instead of h (or the old macro's 'ptr')

The code looks the same to me, although I could have mucked something
up:     https://godbolt.org/z/z76nsqGx3

although Andrew prefers inlines for type checking.


-- 
#Randy
https://people.kernel.org/tglx/notes-about-netiquette
https://subspace.kernel.org/etiquette.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ