linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Darren Hart" <dvhart@infradead.org>,
	"Andr� Almeida" <andrealmeid@igalia.com>,
	linux-kernel@vger.kernel.org, "Jason Gunthorpe" <jgg@nvidia.com>,
	linux-mm@kvack.org
Subject: Re: Futexes & Folios
Date: Sat, 13 May 2023 13:10:56 -0700	[thread overview]
Message-ID: <4b5rvoi6w6nhiihmog6xjftoveohd47oooodekqedo5qhflmrt@jemw5ss5xps3> (raw)
In-Reply-To: <ZF+3xpmouwur4sVE@casper.infradead.org>

On Sat, 13 May 2023, Matthew Wilcox wrote:

>Here's a patch which converts the futex code from using pages to using
>folios.  I do have some questions.
>
> - I assume we really do want to base the key on the page offset of the
>   futex in the file.  That is, it's not good enough to base the key
>   on the folio's index because the folio can be split after setting up
>   the key, and if it is we'd then fail to find the futex later.
> - In hugetlbfs, it doesn't matter whether the pgoff is based on base
>   pages or huge page size -- as long as it's consistent between
>   invocations, everything will work

As tglx already mentioned, yes to both.

>(I have ideas about a get_user_folio() but those are not represented in
>this patch)

Btw, regarding some of the concerns about the gup overhead for futexes
in the physr discussion at lsfmm; 'perf bench futex hash' would be a good
way of measuring any impact at a micro level and going from there. This
is only necessary of course for shared futexes, fast/private ones just
use the address space.

Thanks,
Davidlohr


      parent reply	other threads:[~2023-05-13 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13 16:16 Matthew Wilcox
2023-05-13 19:56 ` Thomas Gleixner
2023-05-13 20:10 ` Davidlohr Bueso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b5rvoi6w6nhiihmog6xjftoveohd47oooodekqedo5qhflmrt@jemw5ss5xps3 \
    --to=dave@stgolabs.net \
    --cc=andrealmeid@igalia.com \
    --cc=dvhart@infradead.org \
    --cc=jgg@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox