Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp641220ybl; Thu, 22 Aug 2019 02:34:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqztXYvQiSEJTjP6dOILIMZzWH9fouKDVu0Yc8Bh6iSpkGbjMNTxkR6VIozaxIHtsBxhbaxB X-Received: by 2002:a17:90b:911:: with SMTP id bo17mr4283396pjb.40.1566466487711; Thu, 22 Aug 2019 02:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566466487; cv=none; d=google.com; s=arc-20160816; b=MP/QdZAV6o3yRQ0uc82oeGbaZriBNtsl4DqirlElKZmhWwKzXTOx0cRuShdVVMbWV+ mE7u7jMAzjYSlQiuAJF6+ldaOuDbEHN2Uer3PGE93KYNYZgp5HDwy162AnA19+JH24uS f7EWl1VgnLmUbYxWjLxfiOZLQALfWWg1y1SnZZLirTm+dz9/gRKnUE9t90qFbcnJ5y8M v1vrFgFMtAYWKh26s5dYNyqTHD75rRoCPm7kpaV6vBaUIk4vnb9z80E+mZ8L7FpM3dd5 TaegSBGepxufor6ZBK46wn4fPR0SRcr+81s+2mmLbUEn9DeBzcR9GoPNFWHz2nRgxt7M t2bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :wdcironportexception:ironport-sdr:ironport-sdr:ironport-sdr :dkim-signature; bh=8DpWw0ttylII6fwOauYYBBFatuJQNTE6SVavALaH3j4=; b=z5ejZLFdZy4wlN+8DRO5snTdsPZOiE/1MM+a+imDZ+ttqArxjtbDeEZVe8jNsaRDy2 HtQeQ+Ows1hGSylwdXjTYtd8760EMAF72MmHBR9LrqIAwX03KSseV3ZlnDH6WGOW2VLO VOM501j3EbiJ7wHZawi1jMzvDrqqkBqaOzodCLfM6JdWcsVOGKm2HNt5TbpBQlU4mVVW z/hPJ3OJz306FVa3AkAphvdZDKPfo2hmb3IoQ++xO/ymuAFInxPBBRQfBwYoqMm+ozto fSJDUbVBIwcU8gV5g18SdnL7GnhguByoSZwBoga9mYqAFJm7wZ4jW3zTyLARaRatlvDB 9Yaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Nbv7gu0w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si2048633pjv.25.2019.08.22.02.34.32; Thu, 22 Aug 2019 02:34:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Nbv7gu0w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731807AbfHVH67 (ORCPT + 99 others); Thu, 22 Aug 2019 03:58:59 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:20003 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730431AbfHVH67 (ORCPT ); Thu, 22 Aug 2019 03:58:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566460739; x=1597996739; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j1ObqNXDvM0ZAwJARyDgXPV48mXMzUSdIC2C+2BkImY=; b=Nbv7gu0wM0KVa0CME18+x2aAPEwaWCro1q0QlXZxqUTpz9Cd0N0QFlIW GNHtiFciIo0YjsFwAQB111RoEbQio481fp74KHwfdtoYHhos+lWS2HyU4 snlMb34rPTohDW7han0akxDKmeieOuXFCbV4GyPOryquRzKrD2xc9ayBd zeSSW35GoBxuCXnwBJlD4ZVQ4BBR2L/zDxCp4/NKckyQ6KBocZqkEBATv ZkyALkdnPgf8AY29ugFStFfgexQFrwIbPej4I7YY+WB2Ek7rI46sLS4Rv HzPfsNh+CsL94dHEZi7G6StBhojI8ZdkWA4F4Y79P2x0mv+O2Cqz01joq g==; IronPort-SDR: OSidCQ5doQF2kMOZG5bDRTLmDjBZQB7H0G7C3t7Nl2VZvfQtZqbakM61P11/02qrbCRhcmEkFo S/T24csiJVO3bEJ+tZneQAdwwxpQec85wsW8BqYMzp6J7CKrad+ThJ07FFBNDS2TTKanDqeayN tzYvL7onRmw3urS/CM7G4NLFCQ318Wa/zkoAqsljCEDS0KDnotAkvOmkg8Dv3Fu+GapWx2FTwo z7FOEKxC72tNnZJ4ydFIT2xjbgfD0gzHGM0lGqh5MBGwGqW7etKOg+U7fs4J6JrbAUJS29pGBg +34= X-IronPort-AV: E=Sophos;i="5.64,415,1559491200"; d="scan'208";a="116397478" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 22 Aug 2019 15:58:59 +0800 IronPort-SDR: zUtC8O9eX33viny11s6xGIjixrSydv/yVx3YKDVtHcYS4nS+nkdHul1uCFtwpSpggDjEOPpoZn war6CGGB3yqRWeuCtTQuqKIxBxGAdCil3H5mM1cLzLCjYtfMirlClk5K+ibiEK21aiM2hYaQ9N 1e6dOHpRiK9/aZYvSYW7CEFhvNvLLXYhWJOmphYsAcHse33EXv6XO0TrKju3a6HJ06I69Iw/81 Xmz/Y0+80Y2JwfRlhQRyWjyovt3OFLN0mrPeD9JGn1uXiCCjAzcTb1IVZuCTtkr2XPYqlCWeBD GQiB5jL39ERwGhzRwHVDIFIP Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 00:56:19 -0700 IronPort-SDR: LMuHXB3z06ZWti+mKQI/IsLz8aTtCS18D19F4tFR9Hrk6jSZb6zcimTZHv+wNvksstATECV2qP 73q5WejYVS1IPw7eHpwmJtow4z6SFnGiXATYL9CsI3PWZhNNgQBbi18SRs5cQzOrk9rcStHT1D XizVxDssMCr3aoDxRre3qw11iWCVVz2nQUJ2kTVcvJOGKJkiH99h06ONnxBUaIFUBVmIu+1i1R eGdJNPvoccxtLCS4DMyC2Uh1uWdhlJWF5r1znhYcGTMNtzJv8lxszy3a0XZVCPQS/qt/NvGtsm WSE= WDCIronportException: Internal Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 22 Aug 2019 00:58:58 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Christoph Hellwig , Anup Patel Subject: [PATCH v4 1/3] RISC-V: Do not invoke SBI call if cpumask is empty Date: Thu, 22 Aug 2019 00:51:49 -0700 Message-Id: <20190822075151.24838-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190822075151.24838-1-atish.patra@wdc.com> References: <20190822075151.24838-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SBI calls are expensive. If cpumask is empty, there is no need to trap via SBI as no remote tlb flushing is required. Signed-off-by: Atish Patra --- arch/riscv/mm/tlbflush.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index df93b26f1b9d..1293b8017ee0 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -14,6 +14,9 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start, { struct cpumask hmask; + if (cpumask_empty(cmask)) + return; + riscv_cpuid_to_hartid_mask(cmask, &hmask); sbi_remote_sfence_vma(hmask.bits, start, size); } -- 2.21.0