Message ID | 20231228084642.1765-1-jszhang@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-12526-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1879489dyb; Thu, 28 Dec 2023 00:59:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/bjwCKUZ5/cMlZwhxdLU+5tHxFAGxzTOBWi3S2B4I1Ux6gxNAf7D313+dZb38R1xN9kza X-Received: by 2002:a05:620a:f82:b0:77f:e0:35b8 with SMTP id b2-20020a05620a0f8200b0077f00e035b8mr11210024qkn.154.1703753978737; Thu, 28 Dec 2023 00:59:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703753978; cv=none; d=google.com; s=arc-20160816; b=fhLK9J9t5M55j+S1x95EdnVV7idyoLmrn+P6/OX6ibLflVFmPojEcjORc/FvaNM6lR AQVP+jnFXydzEMmkDmC1dbwT0ZvJhqRkVdG+uv/pldQ688vxIdUnROkWXQWQJr6C6/gJ QD8F271QqWWPSmbSh+hgtzdQZqdzeu60EfCAaNjmeE7wW986zaDvYTKOBaocgQoZanD4 r4S+pfySgwCw2kY/P+wS+Fr8qpQGR9zR6fhSIHVF7UjFyWKcz785bOAEZN3S87fx32wH deT+TwiYNz9rqB8GqJlgAf2kBhVTabMPL7GGBP8Hw8dpDO7t/iBFWMWW6WGnPLnCE4RH vZvA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12526-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e4-20020a05620a014400b00781565bc683si5004909qkn.203.2023.12.28.00.59.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 00:59:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12526-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12526-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8750B1C20D30 for <ouuuleilei@gmail.com>; Thu, 28 Dec 2023 08:59:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C9D26ABD; Thu, 28 Dec 2023 08:59:25 +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 <jszhang@kernel.org> To: Will Deacon <will@kernel.org>, "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>, Andrew Morton <akpm@linux-foundation.org>, Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>, Catalin Marinas <catalin.marinas@arm.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Arnd Bergmann <arnd@arndb.de> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786515531916052795 X-GMAIL-MSGID: 1786515531916052795 |
Series |
riscv: tlb: avoid tlb flushing on exit & execve
|
|
Message
Jisheng Zhang
Dec. 28, 2023, 8:46 a.m. UTC
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(-)