Received: by 10.223.164.202 with SMTP id h10csp288003wrb; Wed, 29 Nov 2017 22:22:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMb1P5aSThf1s5GQx041f7Rv/WJ4sAL7maH6EtrNG7RMC/sd6EMj9WDUvGqXmsf75GGs+M8/ X-Received: by 10.101.93.136 with SMTP id f8mr1354974pgt.291.1512022978303; Wed, 29 Nov 2017 22:22:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512022978; cv=none; d=google.com; s=arc-20160816; b=qPZDqCIMkE3iG9tQyeuk/IN6RneBuLF087HmTQS93OultMANCSuXY9S/ZI7s4k3TQ2 cfZA4Hf3wVURn5hj/VkqBL1xMFZn+SF8SODFByacrK7Cq2TTazVkUmivoaJxhPbfsew8 uc5OmVVaSH6TiCubVSvT7gpXQ6sDoXjgHLt0xLjemwFBKlu7syU9V2jB7vLDAKnQedu0 YXpqpuSwdlixVJKhBi6xsAboCOlQ6Y74ix+CSErzLznTO4fkJnw/77er8LSYsqdsd9++ L+st+bYS9F6+jOBfOf+xzhK791hImpOGS7Fa4E0gutD0PpaZFTUs9WMmqB5exYEZkmIH Hcqg== 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=74HPy9t41jKWPT6hKDIwva4rUeL7Tj7vigX1YA5IRX0=; b=VHz+qldFlCj6AocQbVS4iWOJINh3jQuJ0KinektNrXXhnxwMTUSPYZamSvbWSncm+H wVumXUkS1MtVY0VIW4MVJRvWep5CrfldqdmWplcOoQKPckDKNppQ0xHGyGFXIg9WEC4R Ma/U2pw2eGayw7mENvNs6385+t73DbvcY8bpJPgRsZLWieOzRsWAMqjbPSK6Nb3isbys Y34kSavFUTnDEOhvkPGzKavaDzizH0I1b2wZTWkvnfuHLfvw589qXUlruaqV39gGqOba q13vicmY0TUCwvyqV/Jpc5HhFToCX1RXLfWwwUZDz7tw6IW/2T8nmzsVF2cmRwQGW4wz yYXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=UuvNX1/j; 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 v24si2535260pgc.614.2017.11.29.22.22.44; Wed, 29 Nov 2017 22:22:58 -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=UuvNX1/j; 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 S1752078AbdK3GWC (ORCPT + 99 others); Thu, 30 Nov 2017 01:22:02 -0500 Received: from mail-cys01nam02on0081.outbound.protection.outlook.com ([104.47.37.81]:4016 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751295AbdK3GWA (ORCPT ); Thu, 30 Nov 2017 01:22:00 -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=74HPy9t41jKWPT6hKDIwva4rUeL7Tj7vigX1YA5IRX0=; b=UuvNX1/jAH5fVvYZacYoyeV4hcXfb8z2jkVesvxF0zWXeobf/nEPhr93qOXsC/QbSjYKoA1lSbiXRQEnHWKFFy/b/oJIjzzZnR++m/zKSimajCVknwCrnOwbjFMSrtUc8zmdj7+Q2mvdNu64PXQgdwrIGw3kcF8rB/zD1zvu7A0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (111.93.218.67) by DM5PR0701MB3832.namprd07.prod.outlook.com (2603:10b6:4:7f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 30 Nov 2017 06:21:57 +0000 Date: Thu, 30 Nov 2017 09:21:40 +0300 From: Yury Norov To: Clement Courbet Cc: linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH v5] lib: optimize cpumask_next_and() Message-ID: <20171130062140.vhidjktddah55q3k@yury-thinkpad> References: <20171129071609.lcvcf3iezr2tcn4j@yury-thinkpad> <20171129093555.11395-1-courbet@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171129093555.11395-1-courbet@google.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: VI1PR0701CA0030.eurprd07.prod.outlook.com (2603:10a6:800:90::16) To DM5PR0701MB3832.namprd07.prod.outlook.com (2603:10b6:4:7f::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e222902c-aaec-40b7-ba4b-08d537baa8f1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603199);SRVR:DM5PR0701MB3832; X-Microsoft-Exchange-Diagnostics: 1;DM5PR0701MB3832;3:cppR+LUctXilFvGlqfMZtbqDbog4sDByIsx8QepIaboCB9HX0zkZ4N4voexNgEjtz+3vicxlElNXmUPO7y70bxWaYRuexsq1xpMgMrmEJluY1I6C1aGL52ESuBECh4XoRyOioWJVF4krayI5XCMcOEMoeuqlXKk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FXzu4SySEFXQeq3SU9/E45VIs34bW2QLOOPn/5gn9KR00RNWtd7E6FUhIRrF8qhOGjnkbilmqaJWdNBgeEO+ndaWdT8iI+rLqNlE8H726Qas+cJLymSzWiuasR5NUCBu6eIhmuBq8dmixRHxD+pFHWztusrFMjlJXTLAxH9/iyq0QItHWITnKSWFsaC6Q8zefSiqYtw/Ty7awpnK1eLQxyHy7DDeGbXKExC2IBUtLzDO34PtHao/SCB8McI3SLE5UVv5XRQjejwzaFqwqYbQF+2P+qn1Ye0FsveaB08Q=;4:IafWMKZVJ7Vuhnc7/DlFY07jZsd/9HR78SoLKgfYCOBLpuY/98hTohHRW6Fudr2yLWG6BhZ9kOcSSAtLkwvYamnVtT+B/qhID364lcdvmsd1M2be5FpaqgBlW4GS9OGZZQCrcetOUuQVM5b1qoUjDyN5KH0IpbFCCH+GR5UiwErvojZ8b9eh3oWvXm4irccBo4NY4KZQrlmBbblEnp1SLaRTCyawGazHGbQT7TkDmL+zuvBIqmfqix04SvzPP7dm+NoNCOQTU8drP01vw8shrA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(93006095)(3002001)(10201501046)(6041248)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(6072148)(201708071742011);SRVR:DM5PR0701MB3832;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM5PR0701MB3832; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(7916004)(346002)(376002)(366004)(11905935001)(199003)(189002)(57704003)(24454002)(16526018)(8936002)(42882006)(50466002)(33646002)(66066001)(8676002)(229853002)(106356001)(6486002)(52116002)(101416001)(97736004)(6496006)(33716001)(68736007)(23726003)(2950100002)(53936002)(76506005)(6306002)(966005)(4326008)(6246003)(83506002)(105586002)(478600001)(189998001)(25786009)(72206003)(81156014)(81166006)(1076002)(7736002)(5660300001)(9686003)(6666003)(47776003)(6916009)(5009440100003)(2906002)(6116002)(3846002)(316002)(16586007)(305945005)(58126008)(76176010)(50986010)(54356010);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR0701MB3832;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX: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;DM5PR0701MB3832;23:DQg4xFadibDTAV4N0mZkXA8j4U1QBXCs0Lhydrw?= =?us-ascii?Q?V6MVQNF8KNEoOwBCm9Xig8aGHWV4HLlcFmZonOakKBDh+vjjhD9bM6EGTwh6?= =?us-ascii?Q?ZetjdKBnv7dgTQuQfGxfZCOCpgJ2o5hs9FGsPjGKvc2S4s7OL4AfkI5HpTdQ?= =?us-ascii?Q?V681aP5pApTYao9xziQpyYP0IC/NmjzIcpbNgDI0tkbhrwC6S/QWS3YR6ggF?= =?us-ascii?Q?e0ylZHp9Ok4bDwgyj7an15J37/YDTIb4wa2WJDkhp2YM3E4ZICvgTLjy9Nv8?= =?us-ascii?Q?I113BiO4zAfrTlF6trpekxOretj2XQc2X1u1KFYPjEq+2IKbkEwhW9U0rAfc?= =?us-ascii?Q?7U2+T/1j39ECkJE9ZGp7KOv0WrkMb0qOZimF+f8PKldMin4fOiXJKw7a5jhO?= =?us-ascii?Q?nr9FKw7M1UCrjNWVQOujVsXgejd/rfnS1jvbmMN5aVpgdS/B1tIuiVsZCTYU?= =?us-ascii?Q?r0xzMTQcaq7AQCGDnSquzagpvf/+NoucatZzdkBgD/T2perFdQeinijPpqqk?= =?us-ascii?Q?EOkX92XdB3dW/nzhQoKHQyW6orKk32gnVtx59DQ+pZxupz2/9KgMxeufKCPQ?= =?us-ascii?Q?BZRFDtwKN7Bs1soUqMOsSiY11AunoDWfPrgtsgi9Q/b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microsoft-Exchange-Diagnostics: 1;DM5PR0701MB3832;6:yXtFmVPP102BNXaIm2i6XpL2kSTjN69XuF/5JsYvVx0MzjY0J+TLxHy1IO1ypamf3ZeyFNImnwW6jka+xDx4dh0zIwD0RlTQxYV34Kqpd5RJ7jInAjpQWDZDQN8y/d+xtpU4UDMf5wDfKQahev1i3ArP+sg3OrPxUl94HcXTyHvodey53Vx9pG/CbVqPFIilzNp2Av+p9Eeh5XoR0nCLONg97ib6yYCsS8Mc9HblvmwAfHKEEnXHWUJFQwT5SSFBqPcGegOp74szQQRsut88qxAGp2PEai2fDoig46hhGa46FTmxyr9q1W/kBVa5CcsdavjkY0ooh+YnR18AotPnXw9wF/hP2t1qsO1bH+C/lMk=;5:bXHHlpKzZ3WxmpQzTwhLrHGsX8DM80+VeBpaOgrXWNF2LMeBHZiuXY+wBvR07nQ6OPH6ZTKNdNfFETdvmQEmWxBfm5hXSMmQnuOkZoOU5hs8FP/qCSlKHgR15Z3LRsUyXONZXr9dnbMx2IZm70jKkCHPPgjAR2PQSZpo31Z+lRc=;24:OS7HZZUNkqlWw7DYzxT9UArBwYdyNqNlIc26v7Oe2oHrCgMpb95/vS0VQXk3wkvV63b5RVls60DcEk27BmJophXqJkLLA5UfWKVKGrAYXgg=;7:UDnqX38H30jej4YCXeqveCOcxxFQmB8qV3En2Ansm4/FiGlIccwFbuzp2eP/vwySKb47UQ6CzsscA3+xhhFjwa5W4r8HoRqJycfz+nvm6sINqx6m1DTQ+2rfT6TH+atiPxUgfHlLOOu7rI3zB8kR15MZ0IQ5NOclWloV+6fc77k29dL4qkWXd95Ym2Q/knSqr5mEotJYK6vjt6v6MYf0LLaZES0vZWOsqjtA3+CL5ip29v8gaN4IEG7XJHBjJTf+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 06:21:57.3933 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e222902c-aaec-40b7-ba4b-08d537baa8f1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0701MB3832 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 10:35:55AM +0100, Clement Courbet wrote: > > > Note that on Arm (), the new c implementation still outperforms the > > > old one that uses c+ the asm implementation of `find_next_bit` [3]. > > What is 'c+'? Is it typo? > > I meant "a mix of C and asm" ~(C + asm). Rephrased. > > > If you find generic find_bit() on arm faster that asm one, we'd > > definitely drop that piece of asm. I have this check it in my > > long list. > > What's faster for sure is the mix (the improvement in this commit minus the > possible hit from not using the ASM implementation). I can't tell whether the > latter is negligible or not (I only have one ARM board to try it out), but > that's definitly something to try. > > > This is old version of test based on get_cycles. New one is based on > > ktime_get and has other minor changes. I think you'd rerun tests to > > not confuse readers. New version is already in linux-next. > > So I'm not sure whether I should be submitting this against 'linux' or > 'linux-next' ? This patch is against 'linux', so I think it should > be consistent with the code around. Linux-next is your choice. https://lwn.net/Articles/289013/ > > > #ifndef find_first_bit > > > #define find_first_bit(addr, size) find_next_bit((addr), (size), 0) > > > #endif > > > #ifndef find_first_zero_bit > > > #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0) > > > #endif > > How this change related to the find_next_and_bit? > > The arm header defines these symbols. Now that we're including > the generic implementation in the arm headers, we need to guard this to > avoid the duplicate definition. So I think it really worth to be separated patch. Really, it's completely nontrivial why adding new function in lib/find_bit.c requires including asm-generic/bitops/find.h in arm and uncore32 asm/bitops.h headers (bug?). And why doing that makes you guard find_first_bit and find_first_zero_bit (another bug?). Headers are always important. Please elaborate it and also CC arm and uncore32 communities, linux-arch and Arnd Bergman. > > > test_find_next_and_bit_ref > > I don't understand the purpose of this. It's obviously clear that > > test_find_next_and_bit cannot be slower than test_find_next_and_bit_ref > > Fair enough :) That was to back my claim that this commit is worth it. > I've removed the "_ref" version. > > > For sparse bitmaps it will be like traversing zero-bitmaps. I doubt > > this numbers will be representative. Do we need this test at all? > > It's just two lines, and gives an interesting data point. Why not > keep it ? --- Again. test_find_next_and_bit is trimmed, but it is still based on get_cycles and uses tabs in printf(). Please fix it. Yury From 1585394007068332473@xxx Wed Nov 29 09:59:05 +0000 2017 X-GM-THRID: 1585315848060842943 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread