Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp276789pxb; Wed, 24 Feb 2021 01:38:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOMMqoZ9mMiKYx5GqfG72cphYzchxazV3WmSIt7o5RJgaC8AeUvJcX4hhrY35JKGKV3B9x X-Received: by 2002:a17:906:4993:: with SMTP id p19mr21730962eju.421.1614159538788; Wed, 24 Feb 2021 01:38:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614159538; cv=none; d=google.com; s=arc-20160816; b=hNInRxLCTjh+nNTwzSmku/O4eqU1Q1ohtAGE1741ETbjugbAQNMbnw1MqPQID18TRP NPrALJoCtdqq3VdVJc0VKEvH+DKPTkqcRPHtg7ea8kguetxS3XBs5BDCH4KvTxTfQhez P8USiyMUuK8rpxIouu0YSpap35yGwUTCAFegUJTRCqHtyhKVNCqzTI2I99RX/6K11aRh fJzsoN3sh2/CD3Gc6pgS1uJDrSL9IXdU6BoV1+YvuWALOaBbsog7U4n0lFhTiUCSuIyf SQQClSQX8anEVx1xr9feVEFM5gSsKvxLGsOZAyvfJsbtjr2Tq7sqdMK4X8B0pkxGJf+d Y7uQ== 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:date :dkim-signature; bh=e5SjnA/T2sWAyv12K9apfKU0L/bNOe782sSdmWlL6R0=; b=m4xBVpc3eT5TbuZLegTelZ9kkIVbvQWbNZl997MF3RrbYiI4EnRTXI40JWSOGRPsw3 BFJISm8Iais7xCDTjb4uNZ4/avx5s3spjs5xXUWFohoYuMVyuL/NuMEpFAbKud5mn+VL SAE3zxFqtEiK2SsG/inH1ztna3R/4zdfiezBRuT8IUGOTcIivRDspUelenpkV8kTS+8M AhhlJXfjTt7prnoRXqqmS+ReeIhbj1ZD6tT1yHu3L5GB2D0CnDyZQKGOVJzXsiCMvSAj ChFYjUlEH+uLlSG1ds0+rTBzM7o0PZuD/63VNp1EljON/Vo2/PkL81Xnt5fwb0VEZJmv NfHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qi1W+/eG"; 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 di24si834464edb.476.2021.02.24.01.38.34; Wed, 24 Feb 2021 01:38:58 -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="qi1W+/eG"; 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 S234669AbhBXJfa (ORCPT + 99 others); Wed, 24 Feb 2021 04:35:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:43270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234612AbhBXJeb (ORCPT ); Wed, 24 Feb 2021 04:34:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 98368614A5; Wed, 24 Feb 2021 09:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614159228; bh=/CF20OHQ7K0JhgmeOCBr7qeOZntk0MWyxxmZPAU4v98=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qi1W+/eGUtnIWAUKAzopoH5TWZl7ik9XR7jKSMR1Rf6v1SNwG4lMWVIR2duhS7AuC fjbpTOWdiry0E4J2dUEHu6JgC+yfF348N1VJ/JWZ5OLn0zE8pK/sG2d7rb/eQEmBjw wzB0y7FzhJyXdDqh4F7HUvmXiLnWjSismhgru7TMyvRVI9wzjYgqzYSmH5soEQhSjY gSIu7pqC9jffD1vUwH5Uds2WX0sjMa5c46/uNXzcGZ/hxRuwcDOu1DggT+PERmTAGt m4WZGyVTry5AEtbD+s8r2xQ8NSHQhKe2SCwTdyiiP46LouNSOd5scwmUPYSwCjFl+I EPzhDr2Crt/eg== Date: Wed, 24 Feb 2021 09:33:44 +0000 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: <20210224093343.GA11306@willie-the-truck> References: <20201205165406.108990-1-yury.norov@gmail.com> <20201207112530.GB4379@willie-the-truck> <20201208103549.GA5887@willie-the-truck> <20210224052744.GA1168363@yury-ThinkPad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210224052744.GA1168363@yury-ThinkPad> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 23, 2021 at 09:27:44PM -0800, Yury Norov wrote: > On Tue, Dec 08, 2020 at 10:35:50AM +0000, Will Deacon wrote: > > 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. > > Ping? Not sure what happened to this. Maybe resend at -rc1? Will