lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170809163434.p356oyarqpqh52hu@node.shutemov.name>
Date:   Wed, 9 Aug 2017 19:34:34 +0300
From:   "Kirill A. Shutemov" <kirill@...temov.name>
To:     jglisse@...hat.com
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm/rmap: try_to_unmap_one() do not call mmu_notifier
 under ptl

On Wed, Aug 09, 2017 at 12:17:09PM -0400, jglisse@...hat.com wrote:
> From: Jérôme Glisse <jglisse@...hat.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: Jérôme Glisse <jglisse@...hat.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Cc: Andrew Morton <akpm@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ