From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CCDBC3A59D for ; Tue, 20 Aug 2019 08:53:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49D8222DBF for ; Tue, 20 Aug 2019 08:53:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JEvN7INh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49D8222DBF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dK9tb/w1a2eaS7XHXXkyRymeaut/rbSuhT/yX3arujQ=; b=JEvN7INhbzqnjJ SBaZQafumVOJhcBJer+HTJXn6SFYLMi+rAKEyE8HgYI0Huz3MN71aZZHE3OfKpQ21LV0LwKFL64pw GnQ2vkr1ZRmcSrcKBuYuBOOgcSANKMbQbI1hhTp8x0kK0IjEfMlO4NjdHoZr4SFS+3pw3W5qcG6HB 7aQZqzWDV1tYtz4nmcitDZGS8TF+c6wizd/MyzzgpZMUfgfuJ+t5E0YDLEqicnkwrqxRcm70jsURP V380wjkrOjdn2ZPS4pSLiFwnb466LKn1mRDEpcgZxteMW9pofx3h2ZfW0s7tXif5hv8m+0cY3bz1L YoX4UhY+kPonx84PE7jw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hzztM-0003gM-A2; Tue, 20 Aug 2019 08:53:24 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hzzrG-0001gp-9b for linux-riscv@lists.infradead.org; Tue, 20 Aug 2019 08:51:16 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46CPf55hJxz1rK4j; Tue, 20 Aug 2019 10:51:09 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46CPf54PDPz1qqkR; Tue, 20 Aug 2019 10:51:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id L20mSo19cVoG; Tue, 20 Aug 2019 10:51:08 +0200 (CEST) X-Auth-Info: xcY6E7IcabXdliwAorIpwgVxvtg+uHfQdCPV1Me18qGqBrFxBMgTnTm+lnzp4WNr Received: from hawking (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 20 Aug 2019 10:51:08 +0200 (CEST) From: Andreas Schwab To: Atish Patra Subject: Re: [v2 PATCH] RISC-V: Optimize tlb flush path. References: <20190820004735.18518-1-atish.patra@wdc.com> X-Yow: Hold the MAYO & pass the COSMIC AWARENESS... Date: Tue, 20 Aug 2019 10:51:07 +0200 In-Reply-To: (Atish Patra's message of "Tue, 20 Aug 2019 08:42:19 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190820_015114_646318_1356E23C X-CRM114-Status: GOOD ( 10.38 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "aou@eecs.berkeley.edu" , "anup@brainfault.org" , "palmer@sifive.com" , "linux-kernel@vger.kernel.org" , "hch@infradead.org" , "paul.walmsley@sifive.com" , "linux-riscv@lists.infradead.org" , "allison@lohutok.net" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Aug 20 2019, Atish Patra wrote: > + > + cpuid = get_cpu(); > + if (!cmask) { > + riscv_cpuid_to_hartid_mask(cpu_online_mask, &hmask); > + goto issue_sfence; > + } > + > + > + if (cpumask_test_cpu(cpuid, cmask) && cpumask_weight(cmask) == > 1) { > + /* Save trap cost by issuing a local tlb flush here */ > + if ((start == 0 && size == -1) || (size > PAGE_SIZE)) > + local_flush_tlb_all(); > + else if (size == PAGE_SIZE) > + local_flush_tlb_page(start); > + goto done; > + } > + > riscv_cpuid_to_hartid_mask(cmask, &hmask); > + > +issue_sfence: > sbi_remote_sfence_vma(hmask.bits, start, size); > +done: > + put_cpu(); > } > > This is much simpler than what I had done in v2. I will address the if > condition around size as well. I still think that this function should be moved out of the header. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A177C3A589 for ; Tue, 20 Aug 2019 08:51:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBF1722DA7 for ; Tue, 20 Aug 2019 08:51:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729495AbfHTIvN (ORCPT ); Tue, 20 Aug 2019 04:51:13 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:53130 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729340AbfHTIvN (ORCPT ); Tue, 20 Aug 2019 04:51:13 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46CPf55hJxz1rK4j; Tue, 20 Aug 2019 10:51:09 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46CPf54PDPz1qqkR; Tue, 20 Aug 2019 10:51:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id L20mSo19cVoG; Tue, 20 Aug 2019 10:51:08 +0200 (CEST) X-Auth-Info: xcY6E7IcabXdliwAorIpwgVxvtg+uHfQdCPV1Me18qGqBrFxBMgTnTm+lnzp4WNr Received: from hawking (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 20 Aug 2019 10:51:08 +0200 (CEST) From: Andreas Schwab To: Atish Patra Cc: "linux-riscv\@lists.infradead.org" , "paul.walmsley\@sifive.com" , "aou\@eecs.berkeley.edu" , "allison\@lohutok.net" , "anup\@brainfault.org" , "linux-kernel\@vger.kernel.org" , "hch\@infradead.org" , "palmer\@sifive.com" Subject: Re: [v2 PATCH] RISC-V: Optimize tlb flush path. References: <20190820004735.18518-1-atish.patra@wdc.com> X-Yow: Hold the MAYO & pass the COSMIC AWARENESS... Date: Tue, 20 Aug 2019 10:51:07 +0200 In-Reply-To: (Atish Patra's message of "Tue, 20 Aug 2019 08:42:19 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Aug 20 2019, Atish Patra wrote: > + > + cpuid = get_cpu(); > + if (!cmask) { > + riscv_cpuid_to_hartid_mask(cpu_online_mask, &hmask); > + goto issue_sfence; > + } > + > + > + if (cpumask_test_cpu(cpuid, cmask) && cpumask_weight(cmask) == > 1) { > + /* Save trap cost by issuing a local tlb flush here */ > + if ((start == 0 && size == -1) || (size > PAGE_SIZE)) > + local_flush_tlb_all(); > + else if (size == PAGE_SIZE) > + local_flush_tlb_page(start); > + goto done; > + } > + > riscv_cpuid_to_hartid_mask(cmask, &hmask); > + > +issue_sfence: > sbi_remote_sfence_vma(hmask.bits, start, size); > +done: > + put_cpu(); > } > > This is much simpler than what I had done in v2. I will address the if > condition around size as well. I still think that this function should be moved out of the header. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."