Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3829300rdb; Thu, 28 Dec 2023 00:59:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzJhOIrxfyTfGtEkFesEAe8zaEtZWB2IN0DhxUqO+abD4JrLPhlnMJ3Y0cxWIuMnolLJFy X-Received: by 2002:a17:902:e809:b0:1d0:7844:5086 with SMTP id u9-20020a170902e80900b001d078445086mr12668574plg.7.1703753975767; Thu, 28 Dec 2023 00:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703753975; cv=none; d=google.com; s=arc-20160816; b=FksWzvlehRoupGgd/+vpr5lK5tYMWeppeFkYPVrT3gm6Yp4lE3e5sxqhQLEt/AzK8i 8dnfJfEMA5wQFmxRTmfQXKvCnb7k5/VXO9rqMhyIaTFjyRrot8qp1ORmHYeONVwhHrxE eNCJKfTTlg68PLJo6MGLNdGC4BFSWsc1y9dZWXDuAkCxWNr4EDwHsiWJL36XGhU4hIMj Iae8YUHjnhCiLsPx9LMCc7S9ipvUH26W0633sf0PJKCC3voO5YrzeA6bBLZ4xf23fXk9 k75Yfnz9jR+FuozDhybLz0a3PelyRqvvdSazQLGmM67SMwl1tqTNbaHebS3DiXQKCFmL JVuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=NLbvKBYCQA6HFCCFLb5FN0RRsLmdzpFNCcTnBGyntMY=; fh=7yoSLDYtBiATajkf0jny2nUhpLBvg39awZKJqL/P6xI=; b=bcnIXzg2IwvhJ6QLMQx/gENgryCcZqvbxo+ALNVDc1VSpK+rbTAtb1AHUVZE4Y3Fq6 08CTZorccIqXqxPrJ12ZzoFjqg3IVzoqeHhxeYViT52HzlZJPvDgKahQ/SQrKmvWdSEU bEzV/WwkYQbwngoQeRN2mS42NkblaCZTESiWCngr9jon7KD9iKTu+DB6J4O3xXb7Wa0a BJKOy48LYiO3+b/L64+KxZQRcO9u4m5iShfkgWkb0bvgxRFL3C/k/0Q6k9btf7PUszmB CErsDcYN970CzEX0+64BTP1h/yzTM4OCuQgEvypQvDekWTLzKGVBHmYUUp6Vz8tHZEt3 WiiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qX3ZXIVu; spf=pass (google.com: domain of linux-kernel+bounces-12526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001d362b90468si12704946plh.286.2023.12.28.00.59.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 00:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qX3ZXIVu; spf=pass (google.com: domain of linux-kernel+bounces-12526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B6FD7B223CD for ; Thu, 28 Dec 2023 08:59:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8401063C9; Thu, 28 Dec 2023 08:59:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qX3ZXIVu" X-Original-To: linux-kernel@vger.kernel.org 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 AE59763A8; Thu, 28 Dec 2023 08:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5CAFC433C8; Thu, 28 Dec 2023 08:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703753962; bh=qac361aQfUYlqbOE3Dx+WRTyiGe1M4tfZJDFMVM+Hlg=; h=From:To:Cc:Subject:Date:From; b=qX3ZXIVuIgqjmnWmLCGIeKFAzN5+ULWtyxoREOb6AT0bMQ9Fv9tUR0fPxd8bAQHoU pyRvZh1oPfse8PUJCM7z9M/EPig3JCXg5znojjv37eq8A99ej39yt2FqtXM73KRciy avt6nUxBjQe9F0Fy2qvg/ZyG+AJ4OGJRBIEnwlsS2/+tQpM+f9yXIkxHmtqC4nQIqP vpwoUfR6TqZYM7Gk+VnYRKZBB475H5QW685Li+FYw3NEwltzrVrIbEr2FBzR4qCMyf A5tkjpJLm3yxEUSP4SUB76u3vF72cxxZocQLLoKcdZ3I8w+KuzZlATfEj535SChZ4I O9W6YEYkQ7hDw== From: Jisheng Zhang To: Will Deacon , "Aneesh Kumar K . V" , Andrew Morton , Nick Piggin , Peter Zijlstra , Catalin Marinas , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH 0/2] riscv: tlb: avoid tlb flushing on exit & execve Date: Thu, 28 Dec 2023 16:46:40 +0800 Message-Id: <20231228084642.1765-1-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The mmu_gather code sets fullmm=1 when tearing down the entire address space for an mm_struct on exit or execve. So if the underlying platform supports ASID, the tlb flushing can be avoided because the ASID allocator will never re-allocate a dirty ASID. But currently, the tlb_finish_mmu() sets fullmm, when in fact it wants to say that the TLB should be fully flushed. So patch1 takes one of Nadav's patch from [1] to fix fullmm semantics. Compared with original patch from[1], the differences are: a. fixes the fullmm semantics in arm64 too b. bring back the fullmm optimization back on arm64. patch2 does the optimization on riscv. Use the performance of Process creation in unixbench on T-HEAD TH1520 platform is improved by about 4%. Link: https://lore.kernel.org/linux-mm/20210131001132.3368247-2-namit@vmware.com/ [1] Jisheng Zhang (1): riscv: tlb: avoid tlb flushing if fullmm == 1 Nadav Amit (1): mm/tlb: fix fullmm semantics arch/arm64/include/asm/tlb.h | 5 ++++- arch/riscv/include/asm/tlb.h | 9 +++++++++ include/asm-generic/tlb.h | 2 +- mm/mmu_gather.c | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) -- 2.40.0