Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1818370lqa; Mon, 29 Apr 2024 23:11:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV76cmyCEiB8UQTFCEtELPZUqK/ShijEwvOG2jvZUT146pBQdHlde/XiSHQdVH0J0qluhVJmSw8UoS0A0fPaS4lkRFsaj7glugx7St1vg== X-Google-Smtp-Source: AGHT+IHJubRRkFC/n1MTLl/pxdLtn2AHd76q5JnMIYdHwFvj8D5n1jBFTALEeSDaZM0gACWesxX/ X-Received: by 2002:a05:6a20:9758:b0:1ad:7e66:659a with SMTP id hs24-20020a056a20975800b001ad7e66659amr13074588pzc.15.1714457515932; Mon, 29 Apr 2024 23:11:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714457515; cv=pass; d=google.com; s=arc-20160816; b=PxVPyQbd40ALOXyZnfvd2DLo2LnqEq78mogzGYXLx49CtyU4VjtUH9/praxfa3UMGS LvhsHu5QtFBV3Z1/W8KArUjwRWHoZB2MzWOqwkJ0ZyXo4BZkMa/BLvVKOq7pjezfGe1w 3ESyEieqP599XonmnMq55xG8nimcq9z3x4r4J7hJSnsg1i4PYXKDQ9ejnLILaLsMoXzu Xdj3R1+t+KfiwJelJpVHRCJWbz0Il3hbp1mR5D+lio0SzXB3o7qacc0mIqGfw8CX8rjY VQ/XVwG0r2m2rKZU7a+J108lF6suCD3vRGbPzaZAAYnIJs4C+hlG+rZgnOxJ9KrWFU0E eQdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZdlhGpDQ/fVaiM+yhWQ/BVMI6K7d3d/5VJV5GnOrrmU=; fh=KLpo452Cx5zhSLYVkq9WrxDwJAFgYSzNuXC55KAu7tY=; b=qTyAJ8yz93hEh/L+2dcZFhSWDTcvMUeJhEZ+b7T+jo+KbMgEpeb/N2O2gbMQFizE82 kqYdx0VY7cCxbum32W5YPfOs56EPCPd61zhRxH/mXV4d6abPmkwi/tYVOS0GcZqr4T+f NkwRCqrdHp1yFN9gW7h19pVhovtiPSku4VYYnsYLAUam2owdOBoOc7Ie6Btv1BOB9cXi e1TLwefq7Tgdqa4bA0CVr61Qckn7WJGRPux533yUFKLUSqTENtte2m8THGCIgyXdUvuK CpQPvO+QZOT4qEKMopt5vReGb8PxD+DwIz7LONVRDRIYJJs7DN3vXNAcPTVD8EFuOl4X eZHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZMVhJCWr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-163395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lx8-20020a17090b4b0800b002b11f9bf969si4870716pjb.179.2024.04.29.23.11.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 23:11:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZMVhJCWr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-163395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 657B228140F for ; Tue, 30 Apr 2024 06:11:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5765F17BA2; Tue, 30 Apr 2024 06:11:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZMVhJCWr" Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5098A6FB1 for ; Tue, 30 Apr 2024 06:11:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714457510; cv=none; b=b14WKnNag5F+UbvF5UsuJ9dV1aV9f2/0ZFp5xjAJexzqhR0Kw3vCi4s+h3ZcSU2hVtyI3bz1WbiicBTs08I6tq/SNPpiS4gjdZNPiBSQzAkFEkXlq+BODLWJ7reDsKD44fR49UD/Ot5/WyGjhwjcghjp7wUX1gxx/YiDZa/VHTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714457510; c=relaxed/simple; bh=psg9Kpeg6qV+BBr+fxz/JG1CvxbYdrB+PuGi+plXzOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X9ExiIIruRieUcCNB90juelhXVwQa78RBDf6wxTXH/L0kKs5/jhbYyd5LbyuyGsVlemY8sJtrFWza1m4vMcUV/XvCMR9EkIOIgpsCXaj2Sa41fFWjCkkwy5GvuJDfuDR34P36n6EKlGHOzTPOeAFl+hJrrqQK+FqzBrndkOXCE8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZMVhJCWr; arc=none smtp.client-ip=209.85.210.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6ebddef73b5so698595a34.3 for ; Mon, 29 Apr 2024 23:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714457508; x=1715062308; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZdlhGpDQ/fVaiM+yhWQ/BVMI6K7d3d/5VJV5GnOrrmU=; b=ZMVhJCWrXatAu9mnUZe38dX+9Kc3pp5W/ZAQtPiYX34YNALFZtdw4AISf2NLOkEQV3 gUH4KnAei8ZMJEmeHsVaAFxhXC1iUV9GKmQTJZ2sghLVFwPtmh1Qj744CM3Gj8+Yv1UV E0Y8VAsRYf2n0d8z1AA6VnhWZ9NS6ZJZAP6F3m9bpvljmkoiQxmTMSGH3Go36b37cW+A +OUjy5bjZSaNvWjN0kH1DbWh5Sp9jsqu/P8llcqRPyD6udvMFMUZQdKDh6KDifOLWFyD hZYvBHGryatN23yTX/OY361lzokzDMdtrrX5CBIDJvfyX7iEUAFMSvd5/EBpr41S11HP 1eyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714457508; x=1715062308; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZdlhGpDQ/fVaiM+yhWQ/BVMI6K7d3d/5VJV5GnOrrmU=; b=nu0wCXr4Wh8mfbBLaHC079Q7z3CXbgmth8cQGZDwTq+1UULKnR3SIJciaoZ/3fXiQB OBSiSFX9xJHFuOxTCLqPiGO0Z3za+S6HQ21tk5WLHDHtVycGVmHqo/5LmiXI1tseODib 7+ghmOlB0WdmyhKeTp9MIateVp4IAV+mCmfWNigsF9W/VVYpCB+ANbhryJsaDvHbPfg+ 1eJaLlcAle2qibdTn4eumdV/fBmCWEFi160qm0d6ipWYPempvMmXKjmSILIispRGUz+f bVHJQ5HSqDutj8UgQsJ5R+fGWvbYDI5s+uxG8SRR7Up9erHCuczpwPMO/XRGXfBMs2d0 Nj6A== X-Forwarded-Encrypted: i=1; AJvYcCUKuOdQxy8BA9lj+r4LgW0OXulCyhrZ305yF3K7K91C14hzc9Z608j0GkvOnzZMLCYWERhO0O2xw6zmxiN5kqDgABqSWoHYujPAL3jv X-Gm-Message-State: AOJu0YzoWJkSZO7CWP7kJf1Dr9qXTBXappWKq5/a8Iccd/Yi1chhdriK Truptkl5kIKoptD4dTT72ZGYRBEsoVWrH6ZB95U7WNedXmzqjKY9 X-Received: by 2002:a05:6830:100f:b0:6ee:29b2:c2c5 with SMTP id a15-20020a056830100f00b006ee29b2c2c5mr5963096otp.1.1714457508264; Mon, 29 Apr 2024 23:11:48 -0700 (PDT) Received: from visitorckw-System-Product-Name ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id m191-20020a633fc8000000b005f751c18d0esm20180088pga.86.2024.04.29.23.11.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 23:11:47 -0700 (PDT) Date: Tue, 30 Apr 2024 14:11:45 +0800 From: Kuan-Wei Chiu To: akpm@linux-foundation.org, yury.norov@gmail.com Cc: linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] bitops: Optimize fns() for improved performance Message-ID: References: <20240430054912.124237-1-visitorckw@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240430054912.124237-1-visitorckw@gmail.com> On Tue, Apr 30, 2024 at 01:49:10PM +0800, Kuan-Wei Chiu wrote: > Hello, > > This patch series optimizes the fns() function by avoiding repeated > calls to __ffs(). Additionally, tests for fns() have been added in > lib/find_bit_benchmark.c. > > Changes in v2: > - Add benchmark test for fns() in lib/find_bit_benchmark.c. > - Change the loop in fns() by counting down from n to 0. > - Add find_bit benchmark result for find_nth_bit in commit message. > > Link to v1: https://lkml.kernel.org/20240406235532.613696-1-visitorckw@gmail.com Sorry for pasting the wrong link, the link to v1 should be: https://lkml.kernel.org/20240426035152.956702-1-visitorckw@gmail.com Regards, Kuan-Wei > > Kuan-Wei Chiu (2): > lib/find_bit_benchmark: Add benchmark test for fns() > bitops: Optimize fns() for improved performance > > include/linux/bitops.h | 12 +++--------- > lib/find_bit_benchmark.c | 25 +++++++++++++++++++++++++ > 2 files changed, 28 insertions(+), 9 deletions(-) > > -- > 2.34.1 >