From patchwork Sat Jul 17 16:14:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12383719 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=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 C3767C636CA for ; Sat, 17 Jul 2021 16:21:04 +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 603776115A for ; Sat, 17 Jul 2021 16:21:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 603776115A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=mail.ustc.edu.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7CaFE5IJCgXj8YnkRSfAVBr3FdqUsNJaV6WAzx4S+/k=; b=QtEIrykPavt0WQ Zv61sfZ7vAJDPebi+QLQpty+GlKUvoyUUVw288QLjJhdPHvMPqNK2FYW/VVUGswY/yBG9yRadJvFX HMXFXX+VZh7FDMzZ2UkGBQPTvg4iliqlL7u9hnQHU2SMjtM+JLj+cJ1M/mi8++dOyFDzqGkTqt+Lg SsJg83y6P3IlqQgUI2PyP2Mjm12Ulv5QAw+tlfuVuOwNji8j14gIdPryAa1vG4K9Dl7XM2mb2gjz8 Ct0SJpmaQ8jD5uUMqPQ2MVyeYxXUbBpfBC4EyYYFTmrHCStcBmzqWJlq5gU5hiQlPhpGOJU+IDd6V mrGJnAf4QMCoAhAS+JVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4n3K-006obE-Fk; Sat, 17 Jul 2021 16:20:34 +0000 Received: from email6.ustc.edu.cn ([2001:da8:d800::8] helo=ustc.edu.cn) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4n3G-006oaB-S8 for linux-riscv@lists.infradead.org; Sat, 17 Jul 2021 16:20:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ustc.edu.cn; s=dkim; h=Received:Date:From:To:Cc:Subject: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=YJt+haE2Sm3TLKcrxpxqRl/5JPhip7THLelT9v5ADVo=; b=WWt45czOxtIdP Tia0fhXd3+CSEOeDje5VRQ5SXcfIGxO7d0knPtE4a9SmB6L+36MlK5iG3xAUdAMl Hl/LAbHWUaWy240U97AFPI3LhV7y2160d9boGtIRW5rOeg7Runi+X0CojZMqHkGZ 9icv1Kn7WlwGb0E2NoEHEzwArdOtjo= Received: from xhacker (unknown [101.86.20.15]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygCXnPw9A_Ngex6CAA--.1530S2; Sun, 18 Jul 2021 00:20:14 +0800 (CST) Date: Sun, 18 Jul 2021 00:14:23 +0800 From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: enable GENERIC_FIND_FIRST_BIT Message-ID: <20210718001423.6b8e1d23@xhacker> MIME-Version: 1.0 X-CM-TRANSID: LkAmygCXnPw9A_Ngex6CAA--.1530S2 X-Coremail-Antispam: 1UD129KBjvdXoW7GFyDGF1kGFyxtFyDAw15CFg_yoWDKrg_Gr yxArZ5G34UZrWIyrWvvF4Sqa1Ykayqga98Zr9Fyr4UWFy3Gw1fJa95tryFqr1xGw4fXFWU Za92qFnF9rnrXjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbrAYjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z2 80aVCY1x0267AKxVW8JVW8Jr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCF s4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWU JVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r W3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8 JbIYCTnIWIevJa73UjIFyTuYvjxUcVWlDUUUU X-CM-SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210717_092031_415850_22B0ACE2 X-CRM114-Status: UNSURE ( 5.12 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Jisheng Zhang riscv doesn't implement architecture-optimized bitsearching functions such as find_first_{zero}_bit() etc. When GENERIC_FIND_FIRST_BIT=n, find_first_bit() is implemented with find_next_bit() which is less efficient. Enable GENERIC_FIND_FIRST_BIT for riscv to get more optimized find_first_bit() implementation, an initial test(lib/find_bit_benchmark) shows find_first_bit() performance is improved by nearly 32%. Signed-off-by: Jisheng Zhang --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 8fcceb8eda07..7ebc54c5c245 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -47,6 +47,7 @@ config RISCV select GENERIC_ATOMIC64 if !64BIT select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_EARLY_IOREMAP + select GENERIC_FIND_FIRST_BIT select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO select GENERIC_IOREMAP select GENERIC_IRQ_MULTI_HANDLER