Re: [PATCH] futex: Avoid hash-bucket locking for mismatched waits

Thomas Gleixner <[email protected]>
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.linux-kernel
Message-ID <87v79lm0kk.ffs@fw13>
On Fri, Jul 31 2026 at 12:26, Usama Arif wrote:
>  
> +	/*
> +	 * A mismatch here refuses the wait without locating the hash bucket;
> +	 * a match is rechecked under the lock below before queueing.
> +	 *
> +	 * get_futex_key() runs get_user_pages_fast() only for shared futexes,
> +	 * so their page is resident and the non-faulting read suffices, with
> +	 * the locked path recovering if it does not.  A private futex may

That's a fairy tale:

       get_futex_key()
          ...
          // shared
          get_user_pages_fast();        // gets a page reference
          ...
          folio = page_folio(page);
          ...

       out:
          folio_put(folio);	       // drops the page reference
          
Thanks,

        tglx
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.