Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp279427rdb; Mon, 29 Jan 2024 01:52:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFytUGfhFj6hZg14CHvFt5fd4cYK+OOMbYa6dc2wqzVWxS77M0uGLRzxsbxN5yOClAYAF48 X-Received: by 2002:a05:622a:1443:b0:42a:6d5d:18ac with SMTP id v3-20020a05622a144300b0042a6d5d18acmr8499941qtx.22.1706521924358; Mon, 29 Jan 2024 01:52:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706521924; cv=pass; d=google.com; s=arc-20160816; b=Om1mpOhpfCRL8fW3ymRonbjTqiKMAeFq56dxw45VyjL/FQxr5RwHXJvcThMqEXMB4G 1WRUckx+6kxsu4BAA0ZzS58Xb4D6ZESnz2fvVS+XkjJV45sFENx0ErTVy7gipQLrXtIP RjQN16VvMWaeGZsKHoC6trddkfu5S9pzXkV65mJSRtONwm64O9WgaYcK7W7wHHsEypwi hw/hSWxq7Ao3gF0SuzRbzCf1gAMlv7HLJnDXryw+uG38okmOonENJEP8Jl9Z/hE/x/sI ZB9zQ9uJi/+wiUGdsiquGf60bhc3gG8HPxmehLjNsRICNZPaA6eiimOWcAE2IRxSBWB5 HyFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9yzt4DIHrUIVFVfUeKe2jRaS2kEdHGM8IDzh7KDyhU4=; fh=yCfJdvnERwuQ2flAmXrDIMuBeH2xy6flyYhl/eI0zE8=; b=FtcjAASxWIFqEQnLOS58bzrTQ1INT37TlQmdyT6MwWnrG6C1cD8ogfFsFkkQVVdL0N XJ5cPCXq3/qpjyNz7vy3kpZCk1vBBYGRci3rO4cdc7vwvvoHZoITyaFO+uuZVlRRNClo Z72D6XuGkEMMzuJGKDHj7ohORAAhBvq3iwSp/TQ/XDZJkIfupFhl2Y23FFZD90HhTiAC VIKu/cP/7N9fuOua7rPvF7bXLQzjMcOH57uk+PV5AbUKFm024ZO29tEqerXZWBBswfnQ qM6IreAS08ihlA9f9YvHewmHQG1n3Rd5gSDR6kQ9b5oFXuIqr95dVAsX1DN21d/GE1FZ j0AQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oaqej0ZZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 15-20020ac8570f000000b0042aa83194fdsi1079614qtw.595.2024.01.29.01.52.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 01:52:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42495-linux.lists.archive=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=Oaqej0ZZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42495-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 212071C2232C for ; Mon, 29 Jan 2024 09:52:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D89055E4A; Mon, 29 Jan 2024 09:51:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oaqej0ZZ" 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 A6AAF5579D for ; Mon, 29 Jan 2024 09:51:44 +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=1706521904; cv=none; b=LptdzPsBG3MUiewf37KyLOFg8IU+GwlFqewzZKja3zH8SRikeglDESddiPNwkWJIL4/qawSkkoD3Ns0R1Bgf3fKBIR52YDL0rhxvjh6QuABeMwOE9ZkxNm4JWg+ofMBfCseBDxvOFol+3z+iEwl0VjxA4C+X8EgMqfoQT9CII7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706521904; c=relaxed/simple; bh=pPcqsz1uE3yIcm/qTdgdW4qxwK1Hx8R1HyPonk2uprY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T0hShGNk/hxf6QFWrcP3MyBH2740PRBks0zdRcnS077MTXtfTrgTB+6qh+El72aM+w3bzzhMa5H3zqzIpViuwLq5Xsa0cOR+cNvbXyw13cdH+V/LT+QJW4C+kKc8fDLM+c+OkrAWqP4u+w86Yiqhe+2NQOAbn6xqAonrftjz9IQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oaqej0ZZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCEA8C43609; Mon, 29 Jan 2024 09:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706521904; bh=pPcqsz1uE3yIcm/qTdgdW4qxwK1Hx8R1HyPonk2uprY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Oaqej0ZZ+tvwKJxMIRiPCQLm/V6l8p1aL0VAtqTi0s8D9hH7dH8niv1rBxXPTD78k sn+ZxKcQ/phWalG8E0pi1o6nicXKbjsyVyK3ofnNJJFAXF1I0kdS4II2+Obj1hs5dh Gc5ATdyDlG97DC13v2EpHxVVkrU2/7JH8UfAcdYX+8UKZsQEdbHyDxPgvyxNVHVbIr 9+8GIFKQL+23YlvYTwlB8VUsjEbAvQwWELbyrVHXAdOXYYNTS2fGj5EGnyETldEBBC o9JYsU/52KZuWTGX7wFgmOAP3nAzL9lbAUgEa3AWcGqKywZsVVx/i2byqWZC8DPHdw b4Uejvm5Pu5MQ== Date: Mon, 29 Jan 2024 17:38:52 +0800 From: Jisheng Zhang To: yunhui cui Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, alexghiti@rivosinc.com, samuel.holland@sifive.com, ajones@ventanamicro.com, mchitale@ventanamicro.com, dylan@andestech.com, sergey.matyukevich@syntacore.com, prabhakar.mahadev-lad.rj@bp.renesas.com, apatel@ventanamicro.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [External] Re: [PATCH] RISC-V: add uniprocessor flush_tlb_range() support Message-ID: References: <20240125062044.63344-1-cuiyunhui@bytedance.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Jan 29, 2024 at 04:26:57PM +0800, yunhui cui wrote: > Hi Jisheng, > > On Mon, Jan 29, 2024 at 4:02 PM Jisheng Zhang wrote: > > > > On Thu, Jan 25, 2024 at 02:20:44PM +0800, Yunhui Cui wrote: > > > Add support for flush_tlb_range() to improve TLB performance for > > > UP systems. In order to avoid the mutual inclusion of tlbflush.h > > > and hugetlb.h, the UP part is also implemented in tlbflush.c. > > > > Hi Yunhui, > > > > IIRC, Samuel sent similar patch series a few weeks ago. > > > > https://lore.kernel.org/linux-riscv/20240102220134.3229156-1-samuel.holland@sifive.com/ > > > > After that series, do you still need this patch? > > Thank you for your reminder. I didn't find it before I mailed my > patch. I just looked at the content of this patch. I understand that > my patch is needed. For a single core, a more concise TLB flush logic > is needed, and it is helpful to improve performance. Currently, riscv UP flush_tlb_range still use flush all TLB entries, obviously it's is a big hammer, this is what your patch is trying to optimize. I'm not sure whether I understand your code correctly or not. Let me know if I misunderstand your code. After patch5 of the Samuel's series, __flush_tlb_range is unified for SMP and UP, so that UP can also benefit from recent improvements, such as range flush rather than all. Thanks > > Thanks, > Yunhui