Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1064599rdb; Fri, 16 Feb 2024 04:31:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWNC+Z1BDeORk2a7RY6tGgGYzDMual8kP/fXWK4x1/AvhV9KGbxhL4jifqra4Okq5stfndyV9p4ai1Tn2S2DsgIwjVKgJPxoe01iNbTNw== X-Google-Smtp-Source: AGHT+IFCkdRaWPBp+Nt/mtwNnRyKcWSwTeS2X4DoquZPgX0izN21ri+Qpx1hFkMgWNGRBPSV0Ii9 X-Received: by 2002:a05:6402:1b0c:b0:561:ceb6:28c6 with SMTP id by12-20020a0564021b0c00b00561ceb628c6mr3185394edb.19.1708086669356; Fri, 16 Feb 2024 04:31:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708086669; cv=pass; d=google.com; s=arc-20160816; b=l28lBsqxW6ou7jEi8WW4q5taruM7H2rqi8r4k3kwFAxHE/kFH9lt/63SvBq8Oj+bHy vqIZefmoHhL7AvGT1FffX150CctBCq5DFzWQ/xPbBC45JydMsghxhRuJdChy9UTQNRxI g6keSF6OUCcxOycg27w98LIiXkgVePA5p2uFywSg6RN5PO27yMY6cnamMncPUrklAEw6 Z3u7G+Eesd43+VFeJ3FiAEsORvVofhpauefJBicgVRhkBVPNJkJBdC2GdoDGtLH8YaX4 iY1GOm80Esbt8qauPRU/oHmBOwf3uqnhwFkBPc1JGWO2dvilULbd2NgD0VK/pzx6ZsW5 Vsmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=ym6zmEkgYqPxFNV4taTth0NjQrV8C1DSmhT44aWXzc8=; fh=r8G2JENgcRo/RTe4xvZO7IzPLZ7yvHykzgF2Da/HHrw=; b=UbR8GXoFSJP3EqXkE5WxpeKszi8jgqsHVaYQutEzd+4dvL54iUCRRX+/0rC50A1O+5 BGnSrymra5buV3tCAaFVZUZcuPVIUt1u89u1NGp8bnt7G+ifMosCvtRiE/8HucE0oahV rqpLZ+NcGTEnYLTlBoAhYmytbIFz5kbDLKu7Cifl1gzgrZWP2XLsTQkx4iDOLNZAGWat tzhY6t0XPSHtv/eBgCKbKgKKCedIJfOug6CjmSAAjKXj7qqFTwVddsRNoNruxFL3v7Um 2Gp1hv0c9E0dRP3oOaQouyOQLXktSXry1b66tpqJtWoms411q8HXyobbdmfgxENUmcFl kXRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-68571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bf19-20020a0564021a5300b00563f2abc7b4si443222edb.410.2024.02.16.04.31.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:31:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-68571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 79A031F253C8 for ; Fri, 16 Feb 2024 12:31:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B78B7FBAC; Fri, 16 Feb 2024 12:30:56 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A7C17F7FB for ; Fri, 16 Feb 2024 12:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708086656; cv=none; b=Lj1pHxO8VBF6HuY1GHWSd1RlmB2M/G/iBwM5cpsVQGfoN/oERR3NXkb6MiE7u8Eq+O+h5Aqw3bQDMPrp53JVaWnYkxQmPJNZY09eC5MbROkWy3bQ47PUPdeGnkjjm/SfV13P8DOYKKu01Q7bPf5K5HMToPKddAquziiRjk9bv2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708086656; c=relaxed/simple; bh=LkCYUVZu3cxw79tfcJ+izPDfRejV/FVLMOZ6EBl0D1k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EzYu6Qzy5PSsVfRUjZiGnWg8wbJv0BlFTBmZEvEyaYd9zwucYhZSNqy/nZNcll6GxUhC5XYWEDaLs9JSEO298MiBj4IU1FVLPVIAAGCMYqrb1fUZ8ihIUYQM7awrGn3JBl4vIeHWW+l+tTOpNJauGnqm/R4FpwMGEwFMUOHXnXI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 102C3C43394; Fri, 16 Feb 2024 12:30:50 +0000 (UTC) Date: Fri, 16 Feb 2024 12:30:48 +0000 From: Catalin Marinas To: Ryan Roberts Cc: Will Deacon , Ard Biesheuvel , Marc Zyngier , James Morse , Andrey Ryabinin , Andrew Morton , Matthew Wilcox , Mark Rutland , David Hildenbrand , Kefeng Wang , John Hubbard , Zi Yan , Barry Song <21cnbao@gmail.com>, Alistair Popple , Yang Shi , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 14/18] arm64/mm: Implement new [get_and_]clear_full_ptes() batch APIs Message-ID: References: <20240215103205.2607016-1-ryan.roberts@arm.com> <20240215103205.2607016-15-ryan.roberts@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240215103205.2607016-15-ryan.roberts@arm.com> On Thu, Feb 15, 2024 at 10:32:01AM +0000, Ryan Roberts wrote: > Optimize the contpte implementation to fix some of the > exit/munmap/dontneed performance regression introduced by the initial > contpte commit. Subsequent patches will solve it entirely. > > During exit(), munmap() or madvise(MADV_DONTNEED), mappings must be > cleared. Previously this was done 1 PTE at a time. But the core-mm > supports batched clear via the new [get_and_]clear_full_ptes() APIs. So > let's implement those APIs and for fully covered contpte mappings, we no > longer need to unfold the contpte. This significantly reduces unfolding > operations, reducing the number of tlbis that must be issued. > > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Catalin Marinas