Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2831233rwo; Mon, 24 Jul 2023 01:46:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEovt1iFRPK33VywXZyZBAIFy+ezyFeXIuTlcF+D88CUNp+2yJ/z4WIQMsuGZgBpdR8tU2w X-Received: by 2002:a17:906:5386:b0:974:771e:6bf0 with SMTP id g6-20020a170906538600b00974771e6bf0mr8801611ejo.56.1690188385134; Mon, 24 Jul 2023 01:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690188385; cv=none; d=google.com; s=arc-20160816; b=nUW26FvR6fs3eFkfNttg1N98hQGcgvp9aQCKrgKu4c42DCOzhE/5c4mn2hILw/DmuK /9h0TMtk8Mqe7HaueS8NmilxtDovrY66E+ZMpLi8bDeFAstRBAENhUFqOopMGpbQjNXU pJUPC0C2WNvC34aioiBDpmDqNpraNMIikWJkpc8uAhcRebANf9A0R3XGesC8HIXIoC4p ZlgIdJvILuNsROrQ7bDSCi1QQbEBt3HrO6wvDu4grvwCLi9HzuUqUu1YD2CjWK0v9RdI 1d8nkzrLi4qsodI9yJq+f5rBrPPJ36LJAR45fAEzFDvWD0Z6ApNQTNrS/Vfo3Rp/bGUO hyvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lXLKkc54fMLMM/N2KJCWPyPI8SZIVUlOs6JlY/D+of8=; fh=AfyCxmQhhQ3+J+YCNtoFIprutFv+rX7XRcVIGr667s0=; b=Jh8s4h6sdGt2S1gVQuiqK+lEb3x+PMitYTt1NMv3E4H8H/IVtosr3PMSt/5XJt6e25 Vnq1pOW3PqPGs1VMNdGm0xtgKT+AVTEqqMTLTqgOBdR2UVBMRpQDedJCSi8CQjZ7HO6L LEIxEwZml+PGn48p25m+MR3/eG6v5O7ukM6slcadelRO276z6uq/2HxPM1GxIf13S6bj Dhli82sZbdCLPpLKce8Hr3tcEA/dkbEQ27lNYasYIwUkVoGc4V22bfNlqH06lene3vzQ BATwoXQULDyceBkBmb0/99UPO9kKnrCpvCkn+MThpb5gU43O4xsHgmGcO1scahRsVE92 0lcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FfriHYhB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a1709062f8800b00993398bcae2si5959210eji.122.2023.07.24.01.46.00; Mon, 24 Jul 2023 01:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FfriHYhB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231501AbjGXIg6 (ORCPT + 99 others); Mon, 24 Jul 2023 04:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbjGXIg5 (ORCPT ); Mon, 24 Jul 2023 04:36:57 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F0C9AD for ; Mon, 24 Jul 2023 01:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690187816; x=1721723816; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=uDhtutM0pr0AK29Z2GxbbSWEScl9EcBUidY6d+4jQdQ=; b=FfriHYhB50uHGUv+Y+a5iS7RD5k5dkrG9TfQNrHniycwGCqbUuFDEQl1 pBH6MBXIcokZrzwctSpHlPmSdETEOP8bmuC09O6+j4AfV5PbieLAGk7ct TLG9EQqLj9vsWX/FkqCmbb15eRKKB8bnnZTGijG1n0hTlhUyNyGfNDs5V w4uHstNa+OQxJA//D4CRVx5dtmlksq0Kwqjn71aIyFJaOfsNXHjkDRyOj Ais0sWNDc/GYH4SFdJLYGc2+adWH0/MPiyyRlo8Hp4fdvqAig5hGocOco I4KyBA2mDT04XP7jEYhxSPlP1h59WxrkPo+02414wml+donaJiCgqoxP6 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10780"; a="370984571" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="370984571" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 01:36:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10780"; a="790886438" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="790886438" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP; 24 Jul 2023 01:36:38 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qNr3U-004i0X-2v; Mon, 24 Jul 2023 11:36:36 +0300 Date: Mon, 24 Jul 2023 11:36:36 +0300 From: Andy Shevchenko To: Yury Norov Cc: Alexander Potapenko , catalin.marinas@arm.com, will@kernel.org, pcc@google.com, andreyknvl@gmail.com, linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, eugenis@google.com, syednwaris@gmail.com, william.gray@linaro.org, Arnd Bergmann Subject: Re: [PATCH v4 1/5] lib/bitmap: add bitmap_{set,get}_value() Message-ID: References: <20230720173956.3674987-1-glider@google.com> <20230720173956.3674987-2-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 22, 2023 at 06:57:23PM -0700, Yury Norov wrote: > On Thu, Jul 20, 2023 at 07:39:52PM +0200, Alexander Potapenko wrote: > > + map[index] &= ~(GENMASK(nbits - 1, 0) << offset); > > 'GENMASK(nbits - 1, 0) << offset' looks really silly. But you followed the thread to get a clue why it's written in this form, right? ... > With all that I think the implementation should look something like > this: I would go this way if and only if the code generation on main architectures with both GCC and clang is better. And maybe even some performance tests need to be provided. ... > Alexander, can you please try the above and compare? > In previous iteration, I asked you to share disassembly listings for the > functions. Can you please do that now? Exactly what we need before going with your suggestion(s). -- With Best Regards, Andy Shevchenko