Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2863068rwr; Fri, 21 Apr 2023 15:50:16 -0700 (PDT) X-Google-Smtp-Source: AKy350byu8XeoVmPNbDpzTVmowPHdSSRKiuPbR/5bK5ujRmCTBwKoIBQ7b52tI9X/6I21uvRi1iZ X-Received: by 2002:a17:903:2450:b0:1a0:563e:b0c4 with SMTP id l16-20020a170903245000b001a0563eb0c4mr7831757pls.2.1682117416115; Fri, 21 Apr 2023 15:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682117416; cv=none; d=google.com; s=arc-20160816; b=McPrYhUEsyQTkLu2SaEE06eeOyp5/VaKLpjdrF8AS0fAhuKHwF0xWxw+AVjkf4irFU ZxdMYiYNdDJMGiUlfY6Iy8YRDf6JGivMlNYJCvcRe1WVClFmdECN2ee1dgnGPFcfItP4 BRNbnWE8W9KzMPPUnT9yRY7Yu/u7A6lJiiVUXzk5QFxFJOtZhCI5wVMgKS9TmPptz8qn LKIQlXWybbeAwiTen1xoHMY9n/YfThQ0UB0/X5X5qg+dTh/UG9vr+VuPNq1JGMQ08+1i XdEg/ULpXfYK/jtBuEqLnEKSfoYXUVONLB7T0JHcF+H0hysRoE02WidE4pGAuL2Q9rsd jfmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=15RShbsbHafAtkHP7bE1KcywW8eNaWBCC5WwysBd87o=; b=mXzCV33gDvLxjdH0LcZudZH/Bba4taLOZyObp9DpRtqfIR+yzV/v/nYGc470boxFY9 RoMx+49orW5HP5UVeH1C6foBw0Sf1CJrGhmGq8COlBDZNG7aiTbpJPBDWF60euAXPJKF sVmWij/1oNSplKTnj6kSkKM5W7iFzLCiNGOZvkKEtkUVHqCMYEFFzRdGwqOeKZad48jN ZU5MTKWfQFmrpMDGRexYG4g6/G+XXcdsXMi6DHxUiCQoUmfagG3lduUA2e2wvCauR3Xr lsWIUOQ/D2MQYe9tSamOFWp/tEr23j5BIe04VpoGB+FJRnO3W7MtF/M8JtTpw/wDuqtg zHjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=X268rOQm; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ku14-20020a170903288e00b001a522ea4e89si5040053plb.125.2023.04.21.15.50.01; Fri, 21 Apr 2023 15:50:16 -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=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=X268rOQm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbjDUWhJ (ORCPT + 99 others); Fri, 21 Apr 2023 18:37:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233793AbjDUWhH (ORCPT ); Fri, 21 Apr 2023 18:37:07 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 876983A92 for ; Fri, 21 Apr 2023 15:36:38 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2497d8066c9so497168a91.0 for ; Fri, 21 Apr 2023 15:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1682116578; x=1684708578; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=15RShbsbHafAtkHP7bE1KcywW8eNaWBCC5WwysBd87o=; b=X268rOQmAauSwpFpkoX8A+VMI3nbTHDxHe03vObHL12UvaNQ9OZDDghjH9vFasft+g PYxDZ2ddlEnrBvSZCCswbGQjuj0a4dR+kh2mJ0z22UZa2NwQu3fbel/NVm1GcQyaY2D+ O50k+TmBf4HHRjAIC8Ls3kC3p1dwuD7vfBIye6nZ4HPWbaqWdHXW444BirS8nDiLAtUU iCsGJUjimDoRzGfcImcCPFqeDTmyul4Bzysh1Fcv0SrV/e/frNSAMaHCrzc2xVjC/QHk wid15bGQMFWU0GREAmCPjVoJuZjI3Ed7vrEJlHnKEii0hoXezMgBGw0KFsqu2RUatHhR JkiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682116578; x=1684708578; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=15RShbsbHafAtkHP7bE1KcywW8eNaWBCC5WwysBd87o=; b=LSoh5Qji5bpWPzjjGO9A8Nb7KVqf41iygCpxyQNjQxrxC8cIvz0XkH4/UAY2mBV3R2 VfZjYgpds3dYxCXEExG2cim+PTgWTAkFiNV3/Ge/XFcZdBmXulVNpdhzN/ONqRk/ZKeY obOw1PYRmG6AVKsi4cG2jeUJLI2meknhySqqj9Z6aZCs4WnE+kUCctnzM/WuJm72252B HTDZP3oip8OFRl2zPm3szhY5C4rPZDURb+wWckJv+Y4gp3gzY12cXGgZcZ8RMnXICfc+ dRp3HmDzYimsemx5uD8D81zMqqO9VwihTTIP2owm1Kp3Kp3XltjjN8RJ40NUDkgks+ds jzjA== X-Gm-Message-State: AAQBX9cODp4+OYHzIgbuoUkwbM3SS54LqXWmkqThw5MIldw+dNA/kMeS ofsjPWffHioU5VoEYOoLgtTz8g== X-Received: by 2002:a17:90a:195d:b0:247:446f:7d05 with SMTP id 29-20020a17090a195d00b00247446f7d05mr6076988pjh.0.1682116578148; Fri, 21 Apr 2023 15:36:18 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id il7-20020a17090b164700b00247150f2091sm5021149pjb.8.2023.04.21.15.36.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Apr 2023 15:36:17 -0700 (PDT) Message-ID: Date: Fri, 21 Apr 2023 16:36:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 3/5] iomap: simplify iomap_init() with PAGE_SECTORS To: Luis Chamberlain Cc: Matthew Wilcox , agk@redhat.com, snitzer@kernel.org, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, hch@infradead.org, djwong@kernel.org, minchan@kernel.org, senozhatsky@chromium.org, patches@lists.linux.dev, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com, da.gomez@samsung.com, kbusch@kernel.org References: <20230421195807.2804512-1-mcgrof@kernel.org> <20230421195807.2804512-4-mcgrof@kernel.org> <47688c1d-9cf1-3e08-1f1d-a051b25d010e@kernel.dk> Content-Language: en-US From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4/21/23 4:30?PM, Luis Chamberlain wrote: > On Fri, Apr 21, 2023 at 04:24:57PM -0600, Jens Axboe wrote: >> On 4/21/23 4:02?PM, Luis Chamberlain wrote: >>> On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote: >>>> On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote: >>>>> Just use the PAGE_SECTORS generic define. This produces no functional >>>>> changes. While at it use left shift to simplify this even further. >>>> >>>> How is FOO << 2 simpler than FOO * 4? >>>> >>>>> - return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE), >>>>> + return bioset_init(&iomap_ioend_bioset, PAGE_SECTORS << 2, >>> >>> We could just do: >>> >>> >>> - return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE), >>> + return bioset_init(&iomap_ioend_bioset, 4 * PAGE_SECTORS, >>> >>> The shift just seemed optimal if we're just going to change it. >> >> It's going to generate the same code, but the multiplication is arguably >> easier to read (or harder to misread). > > Then let's stick with the 4 * PAGE_SECTORS. Let me know if you need another > patch. Just send out a v2 at some point, you've also got a number of cases where there are superfluous parenthesis, at least in patch 4, and Willy pointed one out in an earlier patch too. Didn't check the last one. This will be 6.5 anyway I think, I already sent out the changes for the 6.4 merge window. -- Jens Axboe