Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2850813rwr; Fri, 21 Apr 2023 15:32:50 -0700 (PDT) X-Google-Smtp-Source: AKy350bKWn9/qDREC1DpuQy+MOJ2839elxDrUQqZkByKPAk53e5H2bD4G1l6J3mb0UlS4IvrG4r6 X-Received: by 2002:a05:6a20:54a6:b0:f1:1ab5:5076 with SMTP id i38-20020a056a2054a600b000f11ab55076mr9643490pzk.2.1682116370138; Fri, 21 Apr 2023 15:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682116370; cv=none; d=google.com; s=arc-20160816; b=UjJtAmgY8Lo70RzX/Vjt+S6XoFOqVRgFSHAHSi3PGrNdYmB4WFQbHRjOtBGh+khnpb FY0zj8aWvsFbBK4+Vh2NvVMTTp1Tl1dkA8gItepgneBXf2KZIhACS1DeTCBaaHY9M1XC XpeCJ6xVjLlFmOW/ulnO04Ozw1tXgf2NfdUdaIsFgqTr0in2U2Twa4w14AfLqKA2NVnu 8fxswxkeHQ+hBl+VT4N4yolU4UJdxLq11zFhk45r4GPHCPMOSUAjAHoTBRvcVZey4uKA Lx+9fAIGvkRhb4eGhUj0FRjqNohnChPhYesU1ecfzpUgfltMputY0L23COsZkkYCwgzV PVmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HB77AFqGG2aBz+Earrmv/XakHzRKihV+YVKN5AMto9w=; b=Wz9nhU4atYziz2+w5Tg182gh1utICUGOiypAingj7kj0PrhXpd9ZPJQUsuntfe1zCS 4TS/OW0sWFYGCrX5NeAVjEhPY3ay1Sk/l5gu4QNYClIvlbQ7yRSF2at9xcHQVTW0Z/DN Sn9+2oKFVeJVDPAkh6K7vJ9M9oXEeGChDV97yQ/l362yImqoU/1mpns02RMmqkbE+nww Gl/ItKyWVHaIt3fMwT6f/jf7HX3ZYImh6iJqsNhnZ4RZHkL5XWyrBeWbGX0KPWbbvay5 vMbFIe0bht7bhi9KXJLrbzKPxUmXJM5I6WZUrJK6F87z7BDDpB95PG1ocbQO+eiW1wPt CtJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4FAhsMmp; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 23-20020a631757000000b005131739af72si4974740pgx.755.2023.04.21.15.32.39; Fri, 21 Apr 2023 15:32:50 -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=@infradead.org header.s=bombadil.20210309 header.b=4FAhsMmp; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233751AbjDUWaZ (ORCPT + 99 others); Fri, 21 Apr 2023 18:30:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjDUWaY (ORCPT ); Fri, 21 Apr 2023 18:30:24 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8261A1BF0; Fri, 21 Apr 2023 15:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description; bh=HB77AFqGG2aBz+Earrmv/XakHzRKihV+YVKN5AMto9w=; b=4FAhsMmpd9R2NNkxWh/EOySpZr 3xMTf/cJ0+PNnJ2jbCGrZ6Gm69S6q3oAJkQ5yxUgkzhcpqqnYZvVCHMRG8Q44ftomMGgGmtsv/8/X hLnbhCDJuUrYaDwBuiiHWOQXrGjbspvupGp/eN9bsdk3b24WwsY/XkPvVT5hwOMnBBpGjaVdxENjr JoSB/n2YtzxQjl7qJQXY3ceKtXXJY4bChFW37Up6awJh/gBfz/LWtS/CSRHQfrPbEyn5NMMZ8oBKk 1goaCU9P4Fulz/XxFCHiY4WPfQQd0fy3A/4pu1F6QjPYE6VPjaXVeuxuTCdmZo1zkvy/1rmg6rqcb /nt47FEw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1ppzGj-00BxAj-0p; Fri, 21 Apr 2023 22:30:17 +0000 Date: Fri, 21 Apr 2023 15:30:17 -0700 From: Luis Chamberlain To: Jens Axboe 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 Subject: Re: [PATCH 3/5] iomap: simplify iomap_init() with PAGE_SECTORS Message-ID: References: <20230421195807.2804512-1-mcgrof@kernel.org> <20230421195807.2804512-4-mcgrof@kernel.org> <47688c1d-9cf1-3e08-1f1d-a051b25d010e@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <47688c1d-9cf1-3e08-1f1d-a051b25d010e@kernel.dk> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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, 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. Luis