Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1273175pxb; Thu, 21 Oct 2021 20:07:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjaFwyVt96Z7jdKi5YI0Fj1lluaJLKGulwsqiW0+ZYB3JEgpn8XLo92yMWT9XwGVuYgIYH X-Received: by 2002:aa7:c359:: with SMTP id j25mr13243137edr.348.1634872021514; Thu, 21 Oct 2021 20:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634872021; cv=none; d=google.com; s=arc-20160816; b=zX21lqFZ4kWrOtUDrOFZlvzfnafp1B70ckUob3LJhnh56/uFwrTCJ+FlY0eWGSjr2F roc+BTCIGGFYjNyplIRyRQm9ty8ZikF788LyoWgAtQYOsfxABpO+L0qPtQm15NYrYmQ1 sVsByttGLPUZCAFwEV5PwZs8nk6Mh14BQrS/+MsnafCPYpLqZZPa/YWgNmtCjWEP5IGX aTEsQDQUEh9xklQ0wI0+GzohXCynWqTJVJ5L9hqmLrRp8S7XRoIkC0rAQs6p8sb9E6rK GtcKdWvH1SfGrckEhta759i2Kp1aVETVeDXRBKhrhZkkZ98elhSZ7asPbsXJQQAQL5us 0YMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=gw3fR+k5+UlSHYxSqRVXOG70V0uNWBkn6YIosRCNOq4=; b=hafHs4ynZVh7lSHACdMnIbdBEbnvi7xZtUIScnB3lfOz+YkuV33VeQ03MUbtLK/PbZ IYDTH1iHsqCnGmXzpBEvNblsg/dbwG8EUxWWqhNrTo1B7YhNB2qWfqn0LoHPRNfC0fWR QgQBjT/Mxk5rvxrJVq5UXJ90gpzCGdddneAijADszJrFRbPQjlvIlUxjvPieNsUEbcQA /DIwoxY4znLjXBGDLBK3mmUINc6c0gctxhhEhSld3sKvC2Coo0tUPdr2BF6X6DmnJ3VF WTA9xkirjZCG5gXYI0z/WJK4wyQ7G1dA08YhMAT+tvPz6umHy3pi3DuSEB2JmLl5Zw1U 9/nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Te1ZB1HF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si9238138eji.132.2021.10.21.20.06.32; Thu, 21 Oct 2021 20:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Te1ZB1HF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232271AbhJVDHK (ORCPT + 99 others); Thu, 21 Oct 2021 23:07:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:35524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbhJVDHJ (ORCPT ); Thu, 21 Oct 2021 23:07:09 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?