From: Song Liu <songliubraving@fb.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Matthew Wilcox <matthew.wilcox@oracle.com>,
Peter Zijlstra <peterz@infradead.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
William Kucharski <william.kucharski@oracle.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: + uprobe-use-original-page-when-all-uprobes-are-removed.patch added to -mm tree
Date: Mon, 29 Jul 2019 17:04:05 +0000 [thread overview]
Message-ID: <40C3ABEE-B1D1-445B-9637-A2BD5ED9C316@fb.com> (raw)
In-Reply-To: <20190729150539.GB11349@redhat.com>
> On Jul 29, 2019, at 8:05 AM, Oleg Nesterov <oleg@redhat.com> wrote:
>
> I didn't see this version, so let me reply here.
>
> On 07/26, Andrew Morton wrote:
>>
>> + /* try orig_page only for unregister and anonymous old_page */
>> + if (!is_register && PageAnon(old_page)) {
>
> Well, this is confusing... nothing really wrong, but we certainly do not
> want to install the new anonymous page if !is_register && !PageAnon(old).
> And in this case we do not even want to call __replace page().
>
> OK, I won't insist, this should almost never happen, but again, please
> see https://lore.kernel.org/lkml/20190726084423.GA16112@redhat.com/
I see. Do you want me fold this patch with 2/4?
>
>> + 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 (PageUptodate(orig_page) &&
>> + pages_identical(new_page, orig_page)) {
>> + /* let go new_page */
>> + put_page(new_page);
>> + new_page = NULL;
>> +
>> + /* dec_mm_counter for old_page */
>> + dec_mm_counter(mm, MM_ANONPAGES);
>
> this assumes that __replace_page() can't fail, but it can. I think you
> should move this into into __replace_page().
Good catch! Let me fix it.
Hi Andrew,
Do you prefer a whole v10 (1/4 to 4/4) or just newer version of this
one (2/4)?
Thanks,
Song
next prev parent reply other threads:[~2019-07-29 17:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190726230333.drvM6x-wz%akpm@linux-foundation.org>
2019-07-29 15:05 ` Oleg Nesterov
2019-07-29 17:04 ` Song Liu [this message]
2019-07-30 19:17 ` Andrew Morton
2019-07-30 19:28 ` 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=40C3ABEE-B1D1-445B-9637-A2BD5ED9C316@fb.com \
--to=songliubraving@fb.com \
--cc=akpm@linux-foundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.wilcox@oracle.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.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
all inboxes | Powered by JetHome®