Received: by 10.223.164.202 with SMTP id h10csp368649wrb; Tue, 14 Nov 2017 02:56:01 -0800 (PST) X-Google-Smtp-Source: AGs4zMZHofSgVivWBeQJDb52VxnrSyXdZnKI4FObIRXirzQw13pHs3nI7YaNTB5OIEeha/XmL0G6 X-Received: by 10.101.75.204 with SMTP id p12mr11854500pgr.61.1510656960941; Tue, 14 Nov 2017 02:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510656960; cv=none; d=google.com; s=arc-20160816; b=bKBRrFerSyyVb6kOtQhBmo1QlZUKEAD3KcJ12CryJn5bT3eaepRDBjaQ9ZZr2vNJfg Qj1CmHtF9SGm2sZUWS8EYPX0AqXNDZGiNt6SjxyWZJirZPXnFTG9V8O988GAwwEPawmO mY0FEly2sJXuzNEmCBBIFwBPV7SN0ODYXdLELVzFe1wyDbCYfWqfvkIEKMwaQ2UWirCM G7kI47eb8Liw+rj6mHMxM/IPuHWaVGpuMM9+v6icSTmyK3/bTdAe2BmCh6dd8qnYnWDo QbLBafwNT8UY/6iJ2ie7OV1MFUfcLR7fNQsPI5btqYqa6fdDQMTq+awtN99oIrtwRLdF hX8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=PmzM8tdqWrZWQRys7ohLTtb0n/ATo2LfGqn/HE2fzGM=; b=kQrtKVfKdexCS6do6SWH1H/+Nx7G/pkFnNwNO17r/uue5m85HuPXkXYe+201jJFAAi SX+AdFRF5kK/+XABM7hnjjJ+jPRuiynouOKtdNjQKu2GIt1sRA8t/bVoxtcTYet8P3ED zg9KoW3+5Qsuc9dC4Ay8PmRdOzTBRanbeoY/BvGJ7M68p1uQcDkBakLorsqJblPbTW9T dUIABDzKoyOsgO8GwJQZdMWs8Ln/2Jp58VGCl+dWkUJtFeGeyUtLBPE5vhV4b7Yhfr/W C/XvCvMHhQw2jMgsazE9OBEij6oSmmyXx/Pqi0+9GhFsLTwjxApCoPYMe6uJ8SplqYh4 yveA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=kvpnkQS8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si15433156pgn.282.2017.11.14.02.55.49; Tue, 14 Nov 2017 02:56:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=kvpnkQS8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011AbdKNKHz (ORCPT + 87 others); Tue, 14 Nov 2017 05:07:55 -0500 Received: from mail-bn3nam01on0058.outbound.protection.outlook.com ([104.47.33.58]:34560 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752747AbdKNKHr (ORCPT ); Tue, 14 Nov 2017 05:07:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PmzM8tdqWrZWQRys7ohLTtb0n/ATo2LfGqn/HE2fzGM=; b=kvpnkQS8Ljwd37OpbS1BTej4BknOooG52HaFL2r1We5f+kk4eQbPyrvtuHkNB4+qOVRLhhMjbdP+hQgMc/G3fV1ucNLbWcXBPezBqR0Wx3Y2nRpilW2Si7xdnUWXU2u9+Q3MceOcnOXDu9TLVoMvJjkR0eS3gtcpebbvPjV+lco= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (50.233.148.156) by SN4PR0701MB3839.namprd07.prod.outlook.com (2603:10b6:803:4f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Tue, 14 Nov 2017 10:07:43 +0000 Date: Tue, 14 Nov 2017 13:07:30 +0300 From: Yury Norov To: Alexey Dobriyan Cc: Andrew Morton , linux-kernel@vger.kernel.org, Clement Courbet , Matthew Wilcox , Rasmus Villemoes Subject: Re: [PATCH] lib: test module for find_*_bit() functions Message-ID: <20171114100730.fhqvupfa5oxmutfl@yury-thinkpad> References: <20171109140714.13168-1-ynorov@caviumnetworks.com> <20171109151520.053425b697cd808206996e07@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: VI1P189CA0005.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::18) To SN4PR0701MB3839.namprd07.prod.outlook.com (2603:10b6:803:4f::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63cd37b3-3629-405f-7f35-08d52b478d09 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:SN4PR0701MB3839; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3839;3:63elktfabU2J/UfvDSnluclMrqK73Y/4ZXZQFdqiWu//kqPtE8M6llp6EV6ve+AQzNQj8/UDhNX+cO9MJUOXNmQ2tu7KZ2p2A/7eWgelUHbXj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p3lJ77fhb52W675PS2V75M4gc3EGAR1Oky+g9iKRtlNvEfyMZP/6e/A12RvhSu5a9eOEmBcC18C5pV5KCIXQzlt70C//Ax3DXemBXiIRTfzs15AVwLdoDYkms2I9edmK8rRkKUGvhIZBjftxCUsF5/R5gA1l9gE1mu9JicCa/ljjLTThpQuRKUlAr27NFjG6vNpcxNc32SuldBI/T5ixT1MxkkYqMKvzY44iKwrhqXpOZP/Q+MhXq8oVBxXCL7R/FrD2/3nYNwk2mG6fVRxx0kEj+56UQqDODHz6iTgJU4S3zONvisQA3PiHGPqrGyPqbrmCuiNKlgI8zvUs1CSniUEzqEgBSg+UQcXjEad6iY=;4:cd8dPQq3c/WF6A5tJSg0pkJxzeOtFOgGCI6ymfH+gPtJwP6h7bsorQ9uP+0S00Imdwmin3i9A022Aea6ECb5iYrpslRd5v5ZiQ/aHSmm4VdFglgSgB847nNQsHleBdmKtCO7FUUt07Tc6hmsM0lh7j9m9UWLw2TlJAi7OJ3ZxbO7EW+4LEYZMIDlesuD1ni9r+B+VQ61EJro8lWbFweapJlk75mIYEn/1mVPljip5+uzMJBdMvzVGK23d61/pkhE8CQPvPP5X+5q/LZPtbFkoA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(10201501046)(3002001)(3231022)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN4PR0701MB3839;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN4PR0701MB3839; X-Forefront-PRVS: 04916EA04C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(7916004)(346002)(376002)(189002)(24454002)(199003)(8936002)(316002)(54906003)(16586007)(229853002)(9686003)(4326008)(58126008)(6246003)(66066001)(53936002)(72206003)(47776003)(6496005)(81166006)(97736004)(2950100002)(6916009)(33716001)(76506005)(42882006)(33646002)(81156014)(8676002)(5660300001)(7736002)(305945005)(6666003)(189998001)(1076002)(50986999)(23726003)(76176999)(83506002)(54356999)(6486002)(8666007)(3846002)(6116002)(16526018)(105586002)(50466002)(2906002)(101416001)(25786009)(68736007)(478600001)(39060400002)(106356001)(1411001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0701MB3839;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN4PR0701MB3839;23:lOa00QGmqmaQQA1OWckTUiv0xeZPiroEn03n6O5?= =?us-ascii?Q?0me57+Zh2UIcUMEWKSf78k6HgrhKnxNJa6L+QsK+ImjioFpKkdmbxbSTz4Cn?= =?us-ascii?Q?gaHJBx8pObza4bhLBsfNPamVcS2xhjIY6rzAez2LwUDOTygDq4Ior0U+ddDx?= =?us-ascii?Q?osui58/a4sChnpzd0cEAckeG5xO4oTi+j6vc8Q+lk+EFyTr1X+uxeuuTCqM7?= =?us-ascii?Q?d6MCrh6Iz9nr4cSSwqrTQ0nAmQ1vOVMfx7S+9w1caUIwO6P21CxwLybgYtKG?= =?us-ascii?Q?310osPy9LMnIWJhGPQnApyFkS4iCEtP5tMyZ05InYwT1LJ4Cor5dG5EQOh/7?= =?us-ascii?Q?vsv+1oc0fFvJj4UPTwhLF4JuxfV/H3CBVlLXwevkCLfoBlCq153rrUHGzKmZ?= =?us-ascii?Q?cF7HT618G/0rbXb6smxzot93Znu9ELYzM2mDx0obHk98ygNsI0Ttkx5VIwqG?= =?us-ascii?Q?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nostics: 1;SN4PR0701MB3839;6:jf6e/jHo+YZyW8qfzeWUW0JBdP8Txg4n4vQaYVh8RySMZDUvnB0ktgx7kEfElQ+VnJzNt0rR8yVAkhRnB/2F1qnOgURzUtkWaCPU9Q8MBAR/9YQK2X2UJ+acWKjae9fbpFipig4RxHHrDIbBmtJXETz/mIZFFDIX+eauxO4TQGYh7Nx1MDgVlXoJyiTC8F6CNQ4w4tfuFbz+CWRJcMI6F/YtTaNEpmPe2kQXiUaU2KtyaD6cjUp5GYtOcgtDRiPXc/a15h/uTcqwV80pIdDh8275WZ284m2z0L2GssiKZVE1UH3+KUknkHV2E57u6D2KLQhBt3+8fW1sNW+zDbVh5AynQ6KqxI9taLptFmdkeik=;5:rg9qheiW2/7lCE7EJuS1+YfKc97ey43+0W/p1vAeVlUBRctjA3yVSXfmNj1dPH1HvqGD7tsLT5tNnuQ4mEehZZLCTgvf83DqkVOQiBgAXOo2ILe2pW8reDfrTMWfGl+Z5cK/w/orCoDAI4Sm6yIpblhPG79VZgiUWBN4052D5g4=;24:GNkVfDg7b/QpKp/KBEo2gAMz9PYTygXhjqACCAGgH1JmJUhWCxiHEtKpWXKny2HKoJyvNZzIUf5wtE8XY9/pJ6asjyFKMXu8o4nSF1QQ0XU=;7:URFm3d/VIvNtJLUfBABGRXjhrg86jqXnkcjT5yxF090T5U1CcuKaZYWsvSVykNyxiQ86Q32xVKEVLB/xDj6kLNLanxEgt1OhgX44XtH2nzHsVF40fbI6K86omNXcUAc8Dz4JytMl290ooKNHspaMqxHAuJJ601RFPR9UEOJrPaz1V8gB0s89/ibY9o0nxsN8KXT5LeXguJr88GfGZddYjsIhHGSUwvJVm+yF+oBQx3Cev0TjnYuVDZ+28CQ5a04S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2017 10:07:43.8706 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63cd37b3-3629-405f-7f35-08d52b478d09 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3839 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexey, Andrew, Thanks for comments. On Fri, Nov 10, 2017 at 12:45:18PM +0200, Alexey Dobriyan wrote: > On 11/10/17, Andrew Morton wrote: > > On Thu, 9 Nov 2017 17:07:14 +0300 Yury Norov > > wrote: > > > >> find_bit functions are widely used in the kernel, including hot paths. > >> This module tests performance of that functions in 2 typical scenarios: > >> randomly filled bitmap with relatively equal distribution of set and > >> cleared bits, and sparse bitmap which has 1 set bit for 500 cleared bits. > >> > >> ... > >> > >> +config TEST_FIND_BIT > > > > Well. It doesn't actually "test" the code. It measures its performance ;) > > Yes! > > Yyra, you can grab CONFIG_BENCHMARK_* namespace :-) There's no CONFIG_BENCHMARK_* namespace actually. The 'CONFIG_*_BENCHMARK' is referenced only 3 times in linux sources - CONFIG_RING_BUFFER_BENCHMARK, CONFIG_TRACEPOINT_BENCHMARK and CONFIG_GUP_BENCHMARK, so I simply didn't know about it. Some other tests like lib/rbtree_test.c also measure performance and use TEST namespace, but if you think it's better, I don't object to change it. > Another thing: > > > + > > + return 0; > > +} > > +module_init(find_bit_test); > > + > > +static void __exit test_find_bit_cleanup(void) > > +{ > > +} > > +module_exit(test_find_bit_cleanup); > > module exit hook is entirely unnecessary as you can return -E from init hook. > See lib/test-kstrtox.c Ack. I thought to send v3, but the patch is already in next tree, so I'll send fix in separated patch. OK? Yury From 1583859881023531739@xxx Sun Nov 12 11:34:49 +0000 2017 X-GM-THRID: 1583597789320519869 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread