linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Mike Rapoport <rppt@linux.vnet.ibm.com>
Subject: Re: [PATCH] mm: Don't fault around userfaultfd-registered regions on reads
Date: Fri, 27 Nov 2020 13:28:52 -0500	[thread overview]
Message-ID: <20201127182852.GD6573@xz-x1> (raw)
In-Reply-To: <a240da04-1446-9282-c250-00507b745744@redhat.com>

On Fri, Nov 27, 2020 at 06:00:44PM +0100, David Hildenbrand wrote:
> On 26.11.20 23:23, Peter Xu wrote:
> > Faulting around for reads are in most cases helpful for the performance so that
> > continuous memory accesses may avoid another trip of page fault.  However it
> > may not always work as expected.
> > 
> > For example, userfaultfd registered regions may not be the best candidate for
> > pre-faults around the reads.
> 
> Are we getting uffd faults even though no-one actually accessed it?

Userfaultfd should only notify if someone accessed it.

> So in case I would track what some part of my program actually reads, I
> would get wrong notifications?

For shmem, we can't track it right now, afaict.  The message will only generate
if the page cache is not there.

While tracking page reads without page cache is helpless.. because they're all
zeros.

Thanks,

-- 
Peter Xu


      reply	other threads:[~2020-11-27 18:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 22:23 [PATCH] mm: Don't fault around userfaultfd-registered regions on reads Peter Xu
2020-11-27  8:16 ` Mike Rapoport
2020-11-27 13:31   ` Peter Xu
2020-11-27 12:22 ` Matthew Wilcox
2020-11-27 13:51   ` Peter Xu
2020-11-28  0:33   ` Andrea Arcangeli
2020-11-28 15:29     ` Peter Xu
2020-12-01 19:08       ` Andrea Arcangeli
2020-12-01 21:31       ` Hugh Dickins
2020-12-01 23:42         ` Andrea Arcangeli
2020-11-27 17:00 ` David Hildenbrand
2020-11-27 18:28   ` Peter Xu [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=20201127182852.GD6573@xz-x1 \
    --to=peterx@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).