[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <EA58E3BD-7EB1-4433-8F7F-1E3894F8D563@fb.com>
Date: Wed, 24 Jul 2019 08:23:53 +0000
From: Song Liu <songliubraving@...com>
To: Oleg Nesterov <oleg@...hat.com>
CC: lkml <linux-kernel@...r.kernel.org>, Linux-MM <linux-mm@...ck.org>,
Matthew Wilcox <matthew.wilcox@...cle.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Kernel Team <Kernel-team@...com>,
William Kucharski <william.kucharski@...cle.com>
Subject: Re: [PATCH v7 2/4] uprobe: use original page when all uprobes are
removed
> On Jul 15, 2019, at 8:25 AM, Oleg Nesterov <oleg@...hat.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
Powered by blists - more mailing lists