linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mina Almasry <almasrymina@google.com>,
	Linux-MM <linux-mm@kvack.org>,
	Axel Rasmussen <axelrasmussen@google.com>,
	aarcange@redhat.com
Subject: Re: resv_huge_page underflow with userfaultfd test
Date: Tue, 11 May 2021 22:35:10 -0400	[thread overview]
Message-ID: <YJs+3orgxYdVfwD+@t490s> (raw)
In-Reply-To: <096e28e2-5937-beb2-57f7-d112f9b54d97@oracle.com>

Mike,

On Tue, May 11, 2021 at 07:25:39PM -0700, Mike Kravetz wrote:
> I looked at this a bit more today and am not exactly sure of the
> expected behavior.  The situation is:
> - UFFDIO_COPY is called for hugetlb mapping
>   - the dest address is in a shared mapping
>   - there is a page in the cache associated with the address in the
>     shared mapping
> 
> Currently, the code will fail when trying to update the page cache as
> the entry already exists.  The shm code appears to do the same.
> 
> Quick question.  Is this the expected behavior?  Or, would you expect
> the UFFDIO_COPY to update the page in the page cache, and then resolve
> the fault/update the pte?

AFAICT that's the expected behavior, and it need to be like that so as to avoid
silent data corruption (if the page cache existed, it means the page is not
"missing" at all, then it does not suite for a UFFDIO_COPY as it's only used
for uffd page missing case).  Thanks,

-- 
Peter Xu



  reply	other threads:[~2021-05-12  2:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 21:21 resv_huge_page underflow with userfaultfd test Mina Almasry
2021-05-11  0:33 ` Mike Kravetz
2021-05-11  0:52   ` Mina Almasry
2021-05-11  6:45     ` Axel Rasmussen
2021-05-11  7:08       ` Mina Almasry
2021-05-11 16:38       ` Mike Kravetz
2021-05-11 19:08         ` Mina Almasry
2021-05-12  2:25   ` Mike Kravetz
2021-05-12  2:35     ` Peter Xu [this message]
2021-05-12  3:06       ` Mike Kravetz
     [not found]         ` <20210512065813.89270-1-almasrymina@google.com>
2021-05-12  7:44           ` [PATCH] mm, hugetlb: fix resv_huge_pages underflow on UFFDIO_COPY Mina Almasry
     [not found]           ` <CAJHvVch0ZMapPVEc0Ge5V4KDgNDNhECbqwDi0y9XxsxFXQZ-gg@mail.gmail.com>
     [not found]             ` <c455d241-11f6-95a6-eb29-0ddd94eedbd7@oracle.com>
2021-05-12 19:42               ` Mina Almasry
2021-05-12 20:14                 ` Peter Xu
2021-05-12 21:31                   ` Mike Kravetz
2021-05-12 21:52                     ` Mina Almasry

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=YJs+3orgxYdVfwD+@t490s \
    --to=peterx@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=almasrymina@google.com \
    --cc=axelrasmussen@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.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).