From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E983C433DF for ; Thu, 28 May 2020 19:23:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0408F208B8 for ; Thu, 28 May 2020 19:23:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="IW/bkGhI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0408F208B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 99CD0800B7; Thu, 28 May 2020 15:23:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94D5C8001A; Thu, 28 May 2020 15:23:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83BEF800B7; Thu, 28 May 2020 15:23:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 6E0958001A for ; Thu, 28 May 2020 15:23:45 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 32754180AD830 for ; Thu, 28 May 2020 19:23:45 +0000 (UTC) X-FDA: 76867102410.03.geese65_7800716ebe045 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 0E67B28A4E8 for ; Thu, 28 May 2020 19:23:45 +0000 (UTC) X-HE-Tag: geese65_7800716ebe045 X-Filterd-Recvd-Size: 3413 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 May 2020 19:23:44 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B275207BC; Thu, 28 May 2020 19:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590693823; bh=KWIzbnUdC0/WL0P4Z1bjwKBGnAgV6PACPp1qBqkmfOE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IW/bkGhIbncJGc2idclnVVmK54Dm09dZ8pvN2ZYPXRa9osghjVdrkr5zdOQNP4yPk h4mf680CpeabAzzXMzZBnMQVROL1MW1W9oIPunSyKYRkxNqBDhI/isso0zFpMeBjdS NbY+A39KRCp8HPTEvyg7cFxsfQjFlQTVpee8GO60= Date: Thu, 28 May 2020 12:23:42 -0700 From: Andrew Morton To: Bibo Mao Cc: Thomas Bogendoerfer , Jiaxun Yang , Huacai Chen , Paul Burton , Dmitry Korotin , Philippe =?ISO-8859-1?Q?Mathieu-Daud=E9?= , Stafford Horne , Steven Price , Anshuman Khandual , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport , Sergei Shtylyov , "Maciej W. Rozycki" , linux-mm@kvack.org, David Hildenbrand Subject: Re: [PATCH v7 2/4] mm/memory.c: Update local TLB if PTE entry exists Message-Id: <20200528122342.11e51dd9c7698d68632f2a81@linux-foundation.org> In-Reply-To: <1590546320-21814-3-git-send-email-maobibo@loongson.cn> References: <1590546320-21814-1-git-send-email-maobibo@loongson.cn> <1590546320-21814-3-git-send-email-maobibo@loongson.cn> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0E67B28A4E8 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 27 May 2020 10:25:18 +0800 Bibo Mao 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?