From: Oleg Nesterov <oleg@redhat.com>
To: Song Liu <songliubraving@fb.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>,
Matthew Wilcox <matthew.wilcox@oracle.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Kernel Team <Kernel-team@fb.com>,
William Kucharski <william.kucharski@oracle.com>
Subject: Re: [PATCH v7 2/4] uprobe: use original page when all uprobes are removed
Date: Wed, 24 Jul 2019 10:57:36 +0200 [thread overview]
Message-ID: <20190724085736.GA21599@redhat.com> (raw)
In-Reply-To: <EA58E3BD-7EB1-4433-8F7F-1E3894F8D563@fb.com>
On 07/24, Song Liu wrote:
>
>
> > On Jul 15, 2019, at 8:25 AM, Oleg Nesterov <oleg@redhat.com> wrote:
> >
> >> + if (!is_register) {
> >> + struct page *orig_page;
> >> + pgoff_t index;
> >> +
> >> + index = vaddr_to_offset(vma, vaddr & PAGE_MASK) >> PAGE_SHIFT;
> >> + orig_page = find_get_page(vma->vm_file->f_inode->i_mapping,
> >> + index);
> >> +
> >> + if (orig_page) {
> >> + if (pages_identical(new_page, orig_page)) {
> >
> > Shouldn't we at least check PageUptodate?
>
> For page cache, we only do ClearPageUptodate() on read failures,
Hmm. I don't think so.
> so
> this should be really rare case. But I guess we can check anyway.
Can? I think we should or this code is simply wrong...
> > and I am a bit surprised there is no simple way to unmap the old page
> > in this case...
>
> The easiest way I have found requires flush_cache_page() plus a few
> mmu_notifier calls around it.
But we need to do this anyway? At least with your patch replace_page() still
does this after page_add_file_rmap().
> I think current solution is better than
> that,
perhaps, I won't argue,
> as it saves a page fault.
I don't think it matters in this case.
Oleg.
next prev parent reply other threads:[~2019-07-24 8:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 23:53 [PATCH v7 0/4] THP aware uprobe Song Liu
2019-06-25 23:53 ` [PATCH v7 1/4] mm: move memcmp_pages() and pages_identical() Song Liu
2019-06-25 23:53 ` [PATCH v7 2/4] uprobe: use original page when all uprobes are removed Song Liu
2019-06-26 6:00 ` Srikar Dronamraju
2019-07-15 15:25 ` Oleg Nesterov
2019-07-24 8:23 ` Song Liu
2019-07-24 8:57 ` Oleg Nesterov [this message]
2019-06-25 23:53 ` [PATCH v7 3/4] mm, thp: introduce FOLL_SPLIT_PMD Song Liu
2019-06-25 23:53 ` [PATCH v7 4/4] uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT Song Liu
2019-06-26 6:00 ` Srikar Dronamraju
2019-06-27 6:31 ` Song Liu
2019-06-26 0:03 ` [PATCH v7 0/4] THP aware uprobe Song Liu
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=20190724085736.GA21599@redhat.com \
--to=oleg@redhat.com \
--cc=Kernel-team@fb.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.wilcox@oracle.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=songliubraving@fb.com \
--cc=william.kucharski@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).