From: maobibo <maobibo@loongson.cn>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Huacai Chen" <chenhc@lemote.com>,
"Paul Burton" <paulburton@kernel.org>,
"Dmitry Korotin" <dkorotin@wavecomp.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Stafford Horne" <shorne@gmail.com>,
"Steven Price" <steven.price@arm.com>,
"Anshuman Khandual" <anshuman.khandual@arm.com>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
"Mike Rapoport" <rppt@linux.ibm.com>,
"Sergei Shtylyov" <sergei.shtylyov@cogentembedded.com>,
"Maciej W. Rozycki" <macro@wdc.com>,
linux-mm@kvack.org, "David Hildenbrand" <david@redhat.com>
Subject: Re: [PATCH v7 2/4] mm/memory.c: Update local TLB if PTE entry exists
Date: Fri, 29 May 2020 08:59:31 +0800 [thread overview]
Message-ID: <b577bca0-4218-12e6-d63f-0d12cb0a60f9@loongson.cn> (raw)
In-Reply-To: <20200528122342.11e51dd9c7698d68632f2a81@linux-foundation.org>
On 05/29/2020 03:23 AM, Andrew Morton wrote:
> On Wed, 27 May 2020 10:25:18 +0800 Bibo Mao <maobibo@loongson.cn> wrote:
>
>> If two threads concurrently fault at the same page, the thread that
>> won the race updates the PTE and its local TLB. For now, the other
>> thread gives up, simply does nothing, and continues.
>>
>> It could happen that this second thread triggers another fault, whereby
>> it only updates its local TLB while handling the fault. Instead of
>> triggering another fault, let's directly update the local TLB of the
>> second thread. Function update_mmu_tlb is used here to update local
>> TLB on the second thread, and it is defined as empty on other arches.
>>
>> --- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -2752,6 +2752,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
>> new_page = old_page;
>> page_copied = 1;
>> } else {
>> + update_mmu_tlb(vma, vmf->address, vmf->pte);
>> mem_cgroup_cancel_charge(new_page, memcg, false);
>> }
>>
>
> When applying your patches on top of the -mm tree's changes, the above
> hunk didn't apply. The entire `else' block was removed by
> https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-convert-anon-and-file-thp-to-new-mem_cgroup_charge-api.patch
>
> I assumed that dropping this hunk was appropriate. Please check?
yes, that is appropriate. Sorry to bother you, originally I should format the
patch based on mm-tree.
next prev parent reply other threads:[~2020-05-29 1:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 2:25 [PATCH v7 0/4] MIPS: page fault handling optimization Bibo Mao
2020-05-27 2:25 ` [PATCH v7 1/4] MIPS: Do not flush tlb page when updating PTE entry Bibo Mao
2020-05-27 2:25 ` [PATCH v7 2/4] mm/memory.c: Update local TLB if PTE entry exists Bibo Mao
2020-05-28 19:23 ` Andrew Morton
2020-05-29 0:59 ` maobibo [this message]
2020-05-27 2:25 ` [PATCH v7 3/4] mm/memory.c: Add memory read privilege on page fault handling Bibo Mao
2020-05-27 2:25 ` [PATCH v7 4/4] MIPS: mm: add page valid judgement in function pte_modify Bibo Mao
2020-05-27 11:32 ` [PATCH v7 0/4] MIPS: page fault handling optimization Thomas Bogendoerfer
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=b577bca0-4218-12e6-d63f-0d12cb0a60f9@loongson.cn \
--to=maobibo@loongson.cn \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=chenhc@lemote.com \
--cc=david@redhat.com \
--cc=dkorotin@wavecomp.com \
--cc=f4bug@amsat.org \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=macro@wdc.com \
--cc=paulburton@kernel.org \
--cc=rppt@linux.ibm.com \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=shorne@gmail.com \
--cc=steven.price@arm.com \
--cc=tsbogend@alpha.franken.de \
/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