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: <20241028102427.rhVmBDLD@linutronix.de>
Date: Mon, 28 Oct 2024 11:24:27 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org,
	André Almeida <andrealmeid@...lia.com>,
	Darren Hart <dvhart@...radead.org>,
	Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Valentin Schneider <vschneid@...hat.com>,
	Waiman Long <longman@...hat.com>
Subject: Re: [RFC PATCH 3/3] futex: Use the task local hashmap.

On 2024-10-28 11:22:53 [+0100], Peter Zijlstra wrote:
> >  struct futex_hash_bucket *futex_hash(union futex_key *key)
> >  {
> > +	struct futex_hash_table *fht;
> >  	u32 hash = jhash2((u32 *)key, offsetof(typeof(*key), both.offset) / 4,
> >  			  key->both.offset);
> >  
> > +	fht = current->futex_hash_table;
> > +	if (fht && (key->both.offset & (FUT_OFF_INODE | FUT_OFF_MMSHARED)) == 0)
> > +		return &fht->queues[hash & (fht->slots - 1)];
> 
> Perhaps add a helper like:
> 
> static inline bool futex_key_is_private(struct futex_key *key)
> {
> 	/*
> 	 * Relies on get_futex_key() to set either bit for shared
> 	 * futexes -- see comment with union futex_key.
> 	 */
> 	return !(key->both.offset & (FUT_OFF_INODE | FUT_OFF_MMSHARED));
> }

Oki.

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ