Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp875746lqh; Sun, 5 May 2024 06:04:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyxXldUtRspYmw3kLebkRTR0w8M49LdHw6sS9Z7gfe4tcyckJTrPio2QFFLQ98CDIpQI/N0LjZCH/I8JUk1zZEQCib+A16hdllvjgQXA== X-Google-Smtp-Source: AGHT+IFOkSx9DCbxTatUZTFdDCPK8oILv8k4hEBX+wxtNKzfbhw+GeJB4BLDwrqgh1fheGu6sCZY X-Received: by 2002:a50:8753:0:b0:572:5630:d8d6 with SMTP id 19-20020a508753000000b005725630d8d6mr7498140edv.22.1714914250747; Sun, 05 May 2024 06:04:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714914250; cv=pass; d=google.com; s=arc-20160816; b=AgCs3O+HuQuWyxlAbUIhWYSkZ+mt6H4bqClSQm0E/uO/Hyb2ehitlZLUSuOPUaOgwq t+V2P8Q9CXrXeUCblwuJcNQs8KoPrujTeyrX0jEy5UFUleTXfAF2FZbkGHJlt0pzQNNP E7PU9aAha9Tj93ojF7syca5/LqsNJ3rlQB3hSfzPJ9TXlhkA4IYdG4XcUOPzvw62DstF NfkT5huI09ZytKp8jxNNK9SsOZgIMMNDDkZGj+z04NxoLeyh9B3WWbyBh76Sa7I75Y4Q z4fO2PFXc2JNgND4TmqWZkWMHKA8PPu3YZa05C/JMX0h71e3+4DMSclBd6TLKTdnTGep jA9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=l/LBUcvJiIzDgrwZiwFSQkR1M6CCze4s5DkK2oD7FB4=; fh=yuXNpHcUm2Ks38sfSNtcAbrKizWXtJTW1n4LEhU2Gfc=; b=LpJRSr3duPF9qDPwgj/88577tIiXys3GLzIGug0TAbOadXY5zdBsYi4rKfYBRjrBQG xJwYJ7em3vZjgivo7b0zs9GeZDJTAzHxvqYrhi1fNyL5LkWipklaeyfy9JK/EdOV4jNZ j3FkaM6w4UNwMWdDuSZl7gpdMjexagoinE2tKI2PU+hZCMtZ3eCEUPvMq8fpGf6jKOxM O7/QBqd4hyvDTyHyO4vvyeVulz2sfup3CGg/9jPpPdT+aKsY2YZsN/rpL6c8DYeie09r yyHFpF1qQOZ7aMKc92vwiHfdUc3gqSBa6YbXAn/PECFcY1LXKEPJEEih5eGuz4dlzJjO jXyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-168974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l25-20020a056402345900b00572248efc3dsi3746857edc.94.2024.05.05.06.04.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 06:04:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-168974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7883E1F2164D for ; Sun, 5 May 2024 13:04:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC9FB1BF3F; Sun, 5 May 2024 13:04:03 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56022182CC for ; Sun, 5 May 2024 13:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.86.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714914243; cv=none; b=d5EopMKabq34b6Q1T5XDsXgYZZ+KxL9VEbpRkEnOIrit4OADuTAM7M+eK7qDipf2BNz0Ac/S8InV9Q8L2yOf/CpyxfbLzBBuwGjIkWNqY0HTNB0EUJrH2GSdEtKLYeBzi0NmwjtSiauDsUsOvtmRTa+Dm7K2S/QKQd2SpddESJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714914243; c=relaxed/simple; bh=LWjHih/OHSy6SrCfOa9X/24rEFm3Ua2BeaQBjdKPJY4=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=oGlwSRr4kyQI0V3lI6B3/klgUAFmVPdz0pMbc218i4BOvwRM99afhlJcL/8I66ze/Zb/BTltg5aYplpTu5rY3jcD06KzIHiFx++kgMz322ivIZlyEXqychMe2qf92DFym23BtOY0EUgFRkxsYsVsut855h1Jr+ytqFQ82eoQ7UU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.86.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-273-fKqCY0TxOgquqS3S8_PQKQ-1; Sun, 05 May 2024 14:03:57 +0100 X-MC-Unique: fKqCY0TxOgquqS3S8_PQKQ-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 5 May 2024 14:03:23 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sun, 5 May 2024 14:03:23 +0100 From: David Laight To: 'Kuan-Wei Chiu' , "akpm@linux-foundation.org" , "yury.norov@gmail.com" CC: "linux@rasmusvillemoes.dk" , "n26122115@gs.ncku.edu.tw" , "jserv@ccns.ncku.edu.tw" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3 1/2] lib/test_bitops: Add benchmark test for fns() Thread-Topic: [PATCH v3 1/2] lib/test_bitops: Add benchmark test for fns() Thread-Index: AQHam5eHsEz2ZjZaTki/tQEkD/csqLGIn56Q Date: Sun, 5 May 2024 13:03:23 +0000 Message-ID: <44e9ab62e0f543439eb7566a9f134af6@AcuMS.aculab.com> References: <20240501071647.10228-1-visitorckw@gmail.com> <20240501071647.10228-2-visitorckw@gmail.com> In-Reply-To: <20240501071647.10228-2-visitorckw@gmail.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Kuan-Wei Chiu > Sent: 01 May 2024 08:17 >=20 > Introduce a benchmark test for the fns(). It measures the total time > taken by fns() to process 1,000,000 test data generated using > get_random_long() for each n in the range [0, BITS_PER_LONG). >=20 > example: > test_bitops: fns: 5876762553 ns, 64000000 iterations Great benchmark.... The compiler almost certainly optimises it all away. Assigning the result of fns() to a file scope (global) volatile int should stop that happening. And a real test would actually check the result - just in case someone does something silly. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)