linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: jglisse@redhat.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/rmap: try_to_unmap_one() do not call mmu_notifier under ptl
Date: Wed, 9 Aug 2017 19:34:34 +0300	[thread overview]
Message-ID: <20170809163434.p356oyarqpqh52hu@node.shutemov.name> (raw)
In-Reply-To: <20170809161709.9278-1-jglisse@redhat.com>

On Wed, Aug 09, 2017 at 12:17:09PM -0400, jglisse@redhat.com wrote:
> From: Jerome Glisse <jglisse@redhat.com>
> 
> MMU notifiers can sleep, but in try_to_unmap_one() we call
> mmu_notifier_invalidate_page() under page table lock.
> 
> Let's instead use mmu_notifier_invalidate_range() outside
> page_vma_mapped_walk() loop.
> 
> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Fixes: c7ab0d2fdc84 ("mm: convert try_to_unmap_one() to use page_vma_mapped_walk()")
> ---
>  mm/rmap.c | 36 +++++++++++++++++++++---------------
>  1 file changed, 21 insertions(+), 15 deletions(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index aff607d5f7d2..d60e887f1cda 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1329,7 +1329,8 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
>  	};
>  	pte_t pteval;
>  	struct page *subpage;
> -	bool ret = true;
> +	bool ret = true, invalidation_needed = false;
> +	unsigned long end = address + PAGE_SIZE;

I think it should be 'address + (1UL << compound_order(page))'.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-08-09 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 16:17 jglisse
2017-08-09 16:34 ` Kirill A. Shutemov [this message]
2017-08-09 16:52   ` Jerome Glisse
2017-08-09 20:17     ` Andrew Morton
2017-08-09 20:43       ` Jerome Glisse

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=20170809163434.p356oyarqpqh52hu@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=jglisse@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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