Stable Archive on lore.kernel.org
 help / color / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: jstancek@redhat.com, peterz@infradead.org, will.deacon@arm.com,
	npiggin@gmail.com, aneesh.kumar@linux.ibm.com, namit@vmware.com,
	minchan@kernel.org, mgorman@suse.de, stable@vger.kernel.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [v3 PATCH] mm: mmu_gather: remove __tlb_reset_range() for force flush
Date: Wed, 22 May 2019 09:00:34 +0800
Message-ID: <9c27f777-3330-8e43-e4cf-cc4d9c3e0229@linux.alibaba.com> (raw)
In-Reply-To: <20190521161826.029782de0750c8f5cd2e5dd6@linux-foundation.org>



On 5/22/19 7:18 AM, Andrew Morton wrote:
> On Mon, 20 May 2019 11:17:32 +0800 Yang Shi <yang.shi@linux.alibaba.com> wrote:
>
>> A few new fields were added to mmu_gather to make TLB flush smarter for
>> huge page by telling what level of page table is changed.
>>
>> __tlb_reset_range() is used to reset all these page table state to
>> unchanged, which is called by TLB flush for parallel mapping changes for
>> the same range under non-exclusive lock (i.e. read mmap_sem).  Before
>> commit dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in
>> munmap"), the syscalls (e.g. MADV_DONTNEED, MADV_FREE) which may update
>> PTEs in parallel don't remove page tables.  But, the forementioned
>> commit may do munmap() under read mmap_sem and free page tables.  This
>> may result in program hang on aarch64 reported by Jan Stancek.  The
>> problem could be reproduced by his test program with slightly modified
>> below.
>>
>> ...
>>
>> Use fullmm flush since it yields much better performance on aarch64 and
>> non-fullmm doesn't yields significant difference on x86.
>>
>> The original proposed fix came from Jan Stancek who mainly debugged this
>> issue, I just wrapped up everything together.
> Thanks.  I'll add
>
> Fixes: dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in munmap")
>
> to this.

Thanks, Andrew.



      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20  3:17 Yang Shi
2019-05-21 23:18 ` Andrew Morton
2019-05-22  1:00   ` Yang Shi [this message]

Reply instructions:

You may reply publically 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=9c27f777-3330-8e43-e4cf-cc4d9c3e0229@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=jstancek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=namit@vmware.com \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=will.deacon@arm.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

Stable Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://lore.kernel.org/stable \
		stable@vger.kernel.org stable@archiver.kernel.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox