Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3067653pxu; Tue, 8 Dec 2020 02:39:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWuzQOepKIzsleva/vVY2cxcC8K4IAlcXwIMgYrS4Ltx5entVYD1fYIejfWb8yoeQa0P+b X-Received: by 2002:a05:6402:1a30:: with SMTP id be16mr24461653edb.124.1607423940827; Tue, 08 Dec 2020 02:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607423940; cv=none; d=google.com; s=arc-20160816; b=or/WkYVikt55mS36gML1+GqdBGwq8ykfN/YRbGt4t5ZLN15s7PSGgEi3CcECQe5IAC bTDoNlxBJASD0LZZNFdgH+Rg3L1P8Hhg4xPilwQc0Uvv0Wnv6G+p5JaZwz1CkvvoQ3if 5JbrBeGArkaocioWQMCCNC+uGNdlT2TEAFqjeS1Ap7pjetihETE+RaK5kGi8ukXfLTDd mDoIcpHf4gMavXCkYVNB+e5AcSnpaTPBOMlEWGHJUJf6NCFpcZBMXuEujKXvODAjFsKq Ort9K2uWfLwkgzuQGE9XmNw464PBEU6ntCUDcaqqw61vTFzCFrq708H+CEvXagwNXLkJ ceww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:date; bh=TxAO8Qh03Cpr0xfNf8nhXS34swH6y2+Rya/iaXFhI5o=; b=MpIyw2DBO4WrwDmDrJ5VjrCjeImMT9/mKevSM+uNfXRlBM7ExQbMHAyzx9W/+igmmH sXOFQ81ULspjSnsj6WuOzwTNPpPAdi8sXoG7SDG3BDNF25ffLvEaP4MHn8I7TB82M5TP qdzdWGBS5jJRXURbvf4Sp4oC9rNRBuP0K7fAzZvJIgOPII501hr7O9a5OvF2khop+my0 bO8wIZUHq+v9ayR1mFLakFRJH5Yh8Gb6RI1fdIWTn9NIt5x0OOaNqL+5/0Ed3g/CjhmS GWC3kptHN3NxrqV3Ezt4aavwTzXuLLuU37tOBTc850cye6m3/231Vf23HOsrDdSmtw7e 5wMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jv1ty0fx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si10114292edk.285.2020.12.08.02.38.38; Tue, 08 Dec 2020 02:39:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jv1ty0fx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728843AbgLHKgg (ORCPT + 99 others); Tue, 8 Dec 2020 05:36:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:44474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727965AbgLHKgf (ORCPT ); Tue, 8 Dec 2020 05:36:35 -0500 Date: Tue, 8 Dec 2020 10:35:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607423754; bh=ffXh/ffsFEu14yYkVpY1W+3Tb6JWOvb9jWcp7gmAz2g=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=jv1ty0fx2BX6Qj72fdbIYdZax8z6degjujXihkSyIV3UDb97UyieX87rWb9JnOawd pXhwuacdG+oxlOhtVN1nycBQGosStF8DwNj07kppxrJ/n2SKKvQORxiMA19Mb+xBJs xz71tgAnVkOVazSgi0d+kxvDN5kC6lqWXpiBAtVnBZmobANuUmpOrTEtMaANVSB3PQ gwZO1zItEGR8VUcUdPpVyXosXmXS7/zzf5wYI64aJrLaJl0Qf6RG0/jONM3jY+8OW7 Y0oeCYv2buhqif9br8mchpVwsELCVxhQigueqioBdr8BhNLL7Na0L7A9OlPMlJqJSq KfGD6MFcN2qew== From: Will Deacon To: Yury Norov Cc: Catalin Marinas , linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List , linux-arch@vger.kernel.org, Alexey Klimov Subject: Re: [PATCH] arm64: enable GENERIC_FIND_FIRST_BIT Message-ID: <20201208103549.GA5887@willie-the-truck> References: <20201205165406.108990-1-yury.norov@gmail.com> <20201207112530.GB4379@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 05:59:16PM -0800, Yury Norov wrote: > (CC: Alexey Klimov) > > On Mon, Dec 7, 2020 at 3:25 AM Will Deacon wrote: > > > > On Sat, Dec 05, 2020 at 08:54:06AM -0800, Yury Norov wrote: > > > ARM64 doesn't implement find_first_{zero}_bit in arch code and doesn't > > > enable it in config. It leads to using find_next_bit() which is less > > > efficient: > > > > [...] > > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > > index 1515f6f153a0..2b90ef1f548e 100644 > > > --- a/arch/arm64/Kconfig > > > +++ b/arch/arm64/Kconfig > > > @@ -106,6 +106,7 @@ config ARM64 > > > select GENERIC_CPU_AUTOPROBE > > > select GENERIC_CPU_VULNERABILITIES > > > select GENERIC_EARLY_IOREMAP > > > + select GENERIC_FIND_FIRST_BIT > > > > Does this actually make any measurable difference? The disassembly with > > or without this is _very_ similar for me (clang 11). > > > > Will > > On A-53 find_first_bit() is almost twice faster than find_next_bit(), > according to > lib/find_bit_benchmark. (Thanks to Alexey for testing.) I guess it's more compiler dependent than anything else, and it's a pity that find_next_bit() isn't implemented in terms of the generic find_first_bit() tbh, but if the numbers are as you suggest then I don't have a problem selecting this on arm64. Will