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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 89BF6C33CB1 for ; Tue, 14 Jan 2020 10:50:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4B6FF24676 for ; Tue, 14 Jan 2020 10:50:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="06WPGrTR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B6FF24676 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E3E508E0006; Tue, 14 Jan 2020 05:50:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DEDD28E0003; Tue, 14 Jan 2020 05:50:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2BBD8E0006; Tue, 14 Jan 2020 05:50:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0119.hostedemail.com [216.40.44.119]) by kanga.kvack.org (Postfix) with ESMTP id BA6EB8E0003 for ; Tue, 14 Jan 2020 05:50:08 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 5A15E2827 for ; Tue, 14 Jan 2020 10:50:08 +0000 (UTC) X-FDA: 76375920096.15.pet78_12cb354d8433 X-HE-Tag: pet78_12cb354d8433 X-Filterd-Recvd-Size: 3781 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jan 2020 10:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zpOpHUjbhC0rJlP6b+TZpjlC26yEgKMY83qh9k5bu3U=; b=06WPGrTR6s6NFO7DsI67V5+Wb czeAIAK6w/njHcQBpq93jCuo23ME14WPrkiMr/UMjsHGO4vzBJNoFc9LXxprLIKuw3e+y2ZUtBvLZ tesAN9rgpIW2rciGL43nVoFli7oDpK4HQ3iFt49iyuScNAwqus9zOxEK3vcqfYuHzFIeaPs0BBAi7 lninJVJH/XZ/XwdXFmS0UNyoy8ad6Pjp7JZ2risRViJXfec0wFZmyDB8U3Jbovtk1HYPR8Pb7tIZT HHzHcW9AuK70ebMSNFvqwaf3Oa8sKUUNUr4K72419Hr6A4bsNCLcv3Ssh0Fpm7qAmHGI9JhHtBhUb Y5/ugemyw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1irJls-0008BE-LF; Tue, 14 Jan 2020 10:50:04 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 45F9C304123; Tue, 14 Jan 2020 11:48:26 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1B42629D73921; Tue, 14 Jan 2020 11:50:02 +0100 (CET) Date: Tue, 14 Jan 2020 11:50:02 +0100 From: Peter Zijlstra To: "Aneesh Kumar K.V" Cc: akpm@linux-foundation.org, will@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v3 0/9] Fixup page directory freeing Message-ID: <20200114105002.GD2844@hirez.programming.kicks-ass.net> References: <20200114100145.365527-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200114100145.365527-1-aneesh.kumar@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Tue, Jan 14, 2020 at 03:31:36PM +0530, Aneesh Kumar K.V wrote: > This is a repost of patch series from Peter with the arch specific changes except ppc64 dropped. > ppc64 changes are added here because we are redoing the patch series on top of ppc64 changes. This makes it > easy to backport these changes. Only the first 3 patches need to be backported to stable. > > The thing is, on anything SMP, freeing page directories should observe the > exact same order as normal page freeing: > > 1) unhook page/directory > 2) TLB invalidate > 3) free page/directory > > Without this, any concurrent page-table walk could end up with a Use-after-Free. > This is esp. trivial for anything that has software page-table walkers > (HAVE_FAST_GUP / software TLB fill) or the hardware caches partial page-walks > (ie. caches page directories). > > Even on UP this might give issues since mmu_gather is preemptible these days. > An interrupt or preempted task accessing user pages might stumble into the free > page if the hardware caches page directories. > > This patch series fixup ppc64 and add generic MMU_GATHER changes to support the conversion of other architectures. > I haven't added patches w.r.t other architecture because they are yet to be acked. Obviously looks good to me; will you route this through the Power tree since you're in a hurry to see this fixed?