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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 661CCC433F5 for ; Fri, 22 Oct 2021 03:04:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EBE9F61507 for ; Fri, 22 Oct 2021 03:04:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EBE9F61507 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=kvack.org Received: by kanga.kvack.org (Postfix) id 7430594000C; Thu, 21 Oct 2021 23:04:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F2CC900002; Thu, 21 Oct 2021 23:04:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5703094000C; Thu, 21 Oct 2021 23:04:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0115.hostedemail.com [216.40.44.115]) by kanga.kvack.org (Postfix) with ESMTP id 4819E900002 for ; Thu, 21 Oct 2021 23:04:54 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 06C882DEA8 for ; Fri, 22 Oct 2021 03:04:54 +0000 (UTC) X-FDA: 78722581308.05.5D877FE Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf18.hostedemail.com (Postfix) with ESMTP id ACBAC400208A for ; Fri, 22 Oct 2021 03:04:49 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 524D461504; Fri, 22 Oct 2021 03:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1634871892; bh=rOOKX0MxxSjf3OnxKmLrh/v2fj0RUV88D11YpFGMGQ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Te1ZB1HFPd+wtyIWy1Z//+NasRtCuvJYSA72syQIYymQcX6Qoa/9CJVvKzD/+sOW3 CZitRium4NvKQvyIIM9VYZjYW1E9qeM3SSSbxVNV5dUTJhsKYE6zMtvhwQjHOPzcKq fV13gxGqF1pmGpJPc4sECiX+1LymUHAbUzasezcE= Date: Thu, 21 Oct 2021 20:04:50 -0700 From: Andrew Morton To: Nadav Amit Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Nadav Amit , Andi Kleen , Andrea Arcangeli , Andrew Cooper , Andy Lutomirski , Dave Hansen , Peter Xu , Peter Zijlstra , Thomas Gleixner , Will Deacon , Yu Zhao , Nick Piggin , x86@kernel.org Subject: Re: [PATCH v2 0/5] mm/mprotect: avoid unnecessary TLB flushes Message-Id: <20211021200450.b13499c379a27dbfefe9f5e3@linux-foundation.org> In-Reply-To: <20211021122112.592634-1-namit@vmware.com> References: <20211021122112.592634-1-namit@vmware.com> 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-Server: rspam05 X-Rspamd-Queue-Id: ACBAC400208A X-Stat-Signature: n3amwnwd8myungh4urgqtbpyy9uhos1a Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Te1ZB1HF; spf=pass (imf18.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1634871889-314221 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 Thu, 21 Oct 2021 05:21:07 -0700 Nadav Amit wrote: > This patch-set is intended to remove unnecessary TLB flushes. It is > based on feedback from v1 and several bugs I found in v1 myself. > > Basically, there are 3 optimizations in this patch-set: > 1. Avoiding TLB flushes on change_huge_pmd() that are only needed to > prevent the A/D bits from changing. > 2. Use TLB batching infrastructure to batch flushes across VMAs and > do better/fewer flushes. > 3. Avoid TLB flushes on permission demotion. > > Andrea asked for the aforementioned (2) to come after (3), but this > is not simple (specifically since change_prot_numa() needs the number > of pages affected). [1/5] appears to be a significant fix which should probably be backported into -stable kernels. If you agree with this then I suggest it be prepared as a standalone patch, separate from the other four patches. With a cc:stable. And the remaining patches are a performance optimization. Has any attempt been made to quantify the benefits?