Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2377607rwp; Fri, 14 Jul 2023 05:25:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmL+QjfMTzXpqT5y1FvZb2VZv+bjizXj7KMzxU2N8hebBT8z0Zr4E5bT9qF2WJ09XUEgrT X-Received: by 2002:a05:6871:1d3:b0:1b0:3e84:1dc5 with SMTP id q19-20020a05687101d300b001b03e841dc5mr5216943oad.54.1689337538951; Fri, 14 Jul 2023 05:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689337538; cv=none; d=google.com; s=arc-20160816; b=aQ0m5OVnFAVMXUZMVgvDdrCkPh88uWL5CSf8Jj+jf0cL6eEQIMpcnWlUUVjE7xULlm /ojoLVGeRxmUtH0VAbeP28hAJUpF7/RnAv4kTn8ZEApWVdklsX8EbjfpCqiHV1p8kUNa b0O/y1PKBGVUoh1+srd/Eg7mwP/Qo3+L3qPNifUhitbmgcV8VVLZEubsVFSeYiRogtdQ rSolhSnoyJNKDjXa7tmGC7lHiA0tP5xJoN57qSalq14sfHgpIbnbm1abMhx7SCgR8KlN 8nJKQ1TwYucMlsxG8KnTEynTIISd1gfGTWH6Aq5cF2ohS2BTztsxgDVrQ1mk/wEO/PQY UPFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=16R55gbmSXiUXNQxWIymx0I+9penedcTPq9wO+7lCos=; fh=sgZY7CbXDB8f9yN1oMiTowy3JnDBYbqPCwJQW1Q/Mi8=; b=CoCAKZfarOLaNHbHlGU0Ip98d2bnC5CoZ/0ma2Dj0cqZMujTfq2tb+H5ptkAofC2G1 NmLGjx9pMZmJ8u/9X5HtY4mX6osTGO4/IH31nMRpZOqj5TQGE1bqOS3zzFnRQIk/DlKW aNh/Gt8mjeDWMivDIAVJYKF3Mp8QoOXR9nkkFAatxiLP3R8wfnmglq09Z6+ZBIoaaMeM 3cHR/MGPcv2NdEUUGLloVTz7i7VmRVA4SK8JxRq6Tlnuk0H/3YHFPgvz+wnavPfwnqJN vhbCgbn3O+gA9r7RRORit6Z5HVV7DOCKdKvUUEYqcpr3c/ZfEMeV4wiYl8TlvWsIrh6n sMUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=y7REO+92; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r13-20020a6560cd000000b0055b0e39eed2si6896470pgv.107.2023.07.14.05.25.26; Fri, 14 Jul 2023 05:25:38 -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=@google.com header.s=20221208 header.b=y7REO+92; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235673AbjGNMIZ (ORCPT + 99 others); Fri, 14 Jul 2023 08:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjGNMIX (ORCPT ); Fri, 14 Jul 2023 08:08:23 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF51730ED for ; Fri, 14 Jul 2023 05:08:22 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-783698a37beso73060939f.0 for ; Fri, 14 Jul 2023 05:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689336502; x=1691928502; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=16R55gbmSXiUXNQxWIymx0I+9penedcTPq9wO+7lCos=; b=y7REO+92dtiIq5DKsoK3i79K/GnZSa/0jsg3cYmJ61hmgl+xGQi99YOyPD8I6hC90M uEVjY0HxmwMjSqIBEW2L2jSWB7fPRl+viANMkl6lB12vQamLIfw6RX96y17x8aZrOnZE FJKVhrTYfT7jR4HCSsvJhujjait9JKKT2rxxcljLx1DYdJT+MfehkAGS2szwGq/+YV7e oiMcVoajwbImsrbWDE8CQI72B0O8XgrU2KlzdweygcP7IPBPblgFPLkZec/FvOk4rbTu w9Qsg++U0F2Z7Fv3DpwvEhzezoSeZKdg/1R24iTz/Vs//zsr4EFutglEzCa7uwQTbgcH 2Clw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689336502; x=1691928502; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=16R55gbmSXiUXNQxWIymx0I+9penedcTPq9wO+7lCos=; b=NGXgGyStUjohafNPUs4Rvmko2bSrRVTTARmmCOl1KpbAMmFA7fv6OXQlvjsDRUcJbC PntlK93daz+RFa7Y7yU4elDaxAHnu6iq/GOO/P4TEmF3EsRVt6iPAnkpJ2KFsm4LHnC/ oDMlkmC3XY0Po+abA5g2AMpAfwuCylhemGGXVlzQ6r5Gqr3UjC/Pyye1VksOHbZZ+d22 ryjsQmYyM91m7BR87PHJuHFpohoghVfbRXxWlx/17eNGAZ/jUw/XD5hWWxraCNEJ+QCW dnvGCwCoRxzo94NKJCPOXpON/DlTTjNrdMCW7BJrAwDnU6ppuC0ydxS7ePR0jP6ft1mX SYrg== X-Gm-Message-State: ABy/qLYPtwjUE+O1gJasSb3FqBsmZfZV/hQNstKgDhBJWt3z2kpN13j1 tHnB1gPdSLCWk0sVHJyk6mYB1f2zprLpZ4YKIDcvzA== X-Received: by 2002:a6b:3c0c:0:b0:785:ff35:f340 with SMTP id k12-20020a6b3c0c000000b00785ff35f340mr4602898iob.14.1689336502095; Fri, 14 Jul 2023 05:08:22 -0700 (PDT) MIME-Version: 1.0 References: <20230713125706.2884502-1-glider@google.com> <20230713125706.2884502-2-glider@google.com> In-Reply-To: From: Alexander Potapenko Date: Fri, 14 Jul 2023 14:07:45 +0200 Message-ID: Subject: Re: [v2 1/5] lib/bitmap: add bitmap_{set,get}_value_unaligned() To: Andy Shevchenko Cc: William Breathitt Gray , catalin.marinas@arm.com, will@kernel.org, pcc@google.com, andreyknvl@gmail.com, linux@rasmusvillemoes.dk, yury.norov@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, eugenis@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 Fri, Jul 14, 2023 at 1:28=E2=80=AFPM Andy Shevchenko wrote: > > On Fri, Jul 14, 2023 at 07:19:15AM -0400, William Breathitt Gray wrote: > > On Fri, Jul 14, 2023 at 11:04:16AM +0300, Andy Shevchenko wrote: > > > On Thu, Jul 13, 2023 at 08:05:34PM +0200, Alexander Potapenko wrote: > > > > On Thu, Jul 13, 2023 at 7:29=E2=80=AFPM Andy Shevchenko > > > > wrote: > > > > > On Thu, Jul 13, 2023 at 02:57:01PM +0200, Alexander Potapenko wro= te: > > > > > > The two new functions allow setting/getting values of length up= to > > > > > > BITS_PER_LONG bits at arbitrary position in the bitmap. > > > > > > > > > > A couple of years (?) ago it was a series to achieve something li= ke this with > > > > > better (?) code. Why not resurrect that one? > > > > > > > > > > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2195= 426.html > > > > > > > > It looks more compact thanks to GENMASK, I can cook something based= on > > > > the proposed bitmap_{set,get}_value (and change the names if you > > > > prefer the shorter ones). > > > > But I'd better avoid pulling in the rest of that series without a s= trong need. > > > > > > William, what do you think on this? > > > > > > I'm personally prefer William's version as not only it was published = first > > > it was carefully designed and got a lot of review already. We just ha= dn't had > > > the user for it that time. > > > > Yes, that version went through several revisions so it's been well > > tested and known to work -- as you pointed out it just lacked the users > > to warrant merging it into the tree. If it statisfies the use-case > > required here now, then I think we should it pick it up rather than > > reinvent the solution again. > > > > Also, we probably don't need the "clump" code in there, so perhaps > > splitting it out to just the bitmap_{set,get}_value relevant code is > > fine. > > Agree, thank you for your comments! > > -- > With Best Regards, > Andy Shevchenko > > So would it be fine if I split off bitmap_set_value() and bitmap_get_value() from that series and send it (with the appropriate attribution) instead of my patch 1/5? We'll probably still need to retain patch 2/5 (with the function names chan= ged).