linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Oleg Nesterov <oleg@redhat.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 08:23:53 +0000	[thread overview]
Message-ID: <EA58E3BD-7EB1-4433-8F7F-1E3894F8D563@fb.com> (raw)
In-Reply-To: <20190715152513.GD1222@redhat.com>



> On Jul 15, 2019, at 8:25 AM, Oleg Nesterov <oleg@redhat.com> wrote:
> 
> On 06/25, Song Liu wrote:
>> 
>> This patch allows uprobe to use original page when possible (all uprobes
>> on the page are already removed).
> 
> I can't review. I do not understand vm enough.
> 
>> +	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, so 
this should be really rare case. But I guess we can check anyway. 

> 
> 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. I think current solution is better than
that, as it saves a page fault. 

Thanks,
Song

  reply	other threads:[~2019-07-24  8:24 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 [this message]
2019-07-24  8:57       ` Oleg Nesterov
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=EA58E3BD-7EB1-4433-8F7F-1E3894F8D563@fb.com \
    --to=songliubraving@fb.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=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --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).