mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: akpm@linux-foundation.org
Cc: kirill.shutemov@linux.intel.com, matthew.wilcox@oracle.com,
	peterz@infradead.org, rostedt@goodmis.org, songliubraving@fb.com,
	srikar@linux.vnet.ibm.com, william.kucharski@oracle.com,
	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:05:40 +0200	[thread overview]
Message-ID: <20190729150539.GB11349@redhat.com> (raw)
In-Reply-To: <20190726230333.drvM6x-wz%akpm@linux-foundation.org>

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/

> +		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().

Oleg.


       reply	other threads:[~2019-07-29 15:05 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 [this message]
2019-07-29 17:04   ` Song Liu
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=20190729150539.GB11349@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.wilcox@oracle.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=songliubraving@fb.com \
    --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®