Received: by 10.192.165.148 with SMTP id m20csp2560641imm; Thu, 26 Apr 2018 13:09:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx498OKro4+VReo39aIseKGsBOE3q7aTNIhWuQAGo4NAYBQId16WfUjQ2FOFUbhiUuqVT5D45 X-Received: by 10.98.31.200 with SMTP id l69mr33872756pfj.49.1524773364113; Thu, 26 Apr 2018 13:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524773364; cv=none; d=google.com; s=arc-20160816; b=sqrMY85Tr4GVgb/lyLEKIlQDS2JW3/uuFI7IDInXz9Q8nmGIfxRiTdxIsBw70wOjOF QyieHtdnLvwDC6UxSjwp9ARXCPSUigF+rqIN/Qw2RlI5XNRub1I1HiyYMO1Vj37Xxkiq FtUiZb3xf5xivt/0vyvkNYd3WNHBkFnPYOuXMy+z31grjJ/AFvmu1xdOAVRVOPMTf4mX 6XOx3eiCFUOiR6ts6nOZsm9y6dzupflnuUEPSIf+51izZPACdpt4TTw12pnfzAi6XRki 9Nce6koRhM1Pp9p+5Bc38OAEfFwuNr+QAmQJSEk5RPjVxxXze6UnAItbUKb+2O+ARXZa AylA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=HtW6C3DNE0d/RqyH11pKxt3HkSQKjJZfE2TRim0DVd8=; b=gdYThSePMk9FPGoamtX/C5G6MEaOchWcxMcRNgYVSmtZn0kuX3WRdRqsVhL6maltpl gBDmwvxnplB27iU/FHUAcWVuzj5hitixMQ2oGEBVAnqxgoN5dLJ1adRwwV84feIF8sKD 15tNz9VzuXFHjVO2qEYWmHb0dZU/HOdMrS61AZi6WMnWD1QR7f9vNRPGYc+sx+KyXvRv SDKLwN91pac6LxLmfY3sxne02mCVTMYu1jo2COEqqILSgnJ3rxmw60wbqm7LjFmk8qTd 5SbG8/3rRvVdR3KR6cJWFcDQL6w2vfo3ji4tk89xgx0DRWMUwk1XbKaVGbvbx87VczHt n8KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=kdEjNscN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si16191540pgt.196.2018.04.26.13.09.02; Thu, 26 Apr 2018 13:09:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=kdEjNscN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755014AbeDZUHl (ORCPT + 99 others); Thu, 26 Apr 2018 16:07:41 -0400 Received: from 8bytes.org ([81.169.241.247]:54596 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752418AbeDZUHj (ORCPT ); Thu, 26 Apr 2018 16:07:39 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id EA0B7134; Thu, 26 Apr 2018 22:07:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1524773257; bh=dkLBUJflmCFg3en9AZMDKR5VWaNHNpIP9e4+DWprBjQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kdEjNscN3UAvEp3Nf1lvHzzTds+oRGTu872SYtasqdCNE0P4UsF2crepvZTSbuA5/ Jeb2r6cUNeRKzUt3Y/XxKSUrrvuwwGkgQyo+6DD4ScX0mfekFKZ0gECkAfJsGViMOX WBY9kcYayoe9NuYvhjRlUJBrTCzy7oe5afPgo+0WRD0nDs2fI2JLi91hLn1ogCyENa DaY00Qg1kLbunjY5Q3F7LD/M1cOVdu+CklN4lZJXAmvHyV1+nyrwUnAq2zDLmkYgrE Bok5VChD/IhF5+z7wQCUASMyz8bXFZsBGVs59hHA7djwoTGuVLzNuJKS4jXT/qVThh G2IxxEr0LPkSg== Date: Thu, 26 Apr 2018 22:07:37 +0200 From: "joro@8bytes.org" To: "Kani, Toshi" Cc: "linux-kernel@vger.kernel.org" , "bp@suse.de" , "tglx@linutronix.de" , "linux-mm@kvack.org" , "guohanjun@huawei.com" , "wxf.wang@hisilicon.com" , "stable@vger.kernel.org" , "x86@kernel.org" , "akpm@linux-foundation.org" , "willy@infradead.org" , "hpa@zytor.com" , "catalin.marinas@arm.com" , "mingo@redhat.com" , "will.deacon@arm.com" , "Hocko, Michal" , "cpandya@codeaurora.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2 2/2] x86/mm: implement free pmd/pte page interfaces Message-ID: <20180426200737.GS15462@8bytes.org> References: <20180314180155.19492-1-toshi.kani@hpe.com> <20180314180155.19492-3-toshi.kani@hpe.com> <20180426141926.GN15462@8bytes.org> <1524759629.2693.465.camel@hpe.com> <20180426172327.GQ15462@8bytes.org> <1524764948.2693.478.camel@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524764948.2693.478.camel@hpe.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 05:49:58PM +0000, Kani, Toshi wrote: > On Thu, 2018-04-26 at 19:23 +0200, joro@8bytes.org wrote: > > So the PMD entry you clear can still be in a page-walk cache and this > > needs to be flushed too before you can free the PTE page. Otherwise > > page-walks might still go to the page you just freed. That is especially > > bad when the page is already reallocated and filled with other data. > > I do not understand why we need to flush processor caches here. x86 > processor caches are coherent with MESI. So, clearing an PMD entry > modifies a cache entry on the processor associated with the address, > which in turn invalidates all stale cache entries on other processors. A page walk cache is not about the processors data cache, its a cache similar to the TLB to speed up page-walks by caching intermediate results of previous page walks. Thanks, Joerg