Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5164793rwr; Sun, 23 Apr 2023 23:04:28 -0700 (PDT) X-Google-Smtp-Source: AKy350atCUQqvs1hEce1fVR1+Ute8midmfadDc2BVtqSdmL+V6dXg+3pbUQjzRppasOZqQL2uhXE X-Received: by 2002:a05:6a20:5493:b0:d5:7f0b:f2f with SMTP id i19-20020a056a20549300b000d57f0b0f2fmr17133174pzk.26.1682316267581; Sun, 23 Apr 2023 23:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682316267; cv=none; d=google.com; s=arc-20160816; b=Ki0P0Dv60biZajCcTXJV0xKm3tRwsu+CUmIAiQf3fVY0uMnxn6+9T6wlt2Y/apNbl7 ygK2fqEqSYRdpJhTdmzLV2EmHYqW5iSvp+x+lm/m6cLIEHpnkLEdyrdoLCYZux96kEVu chPPFBR5GAs83iGf9TFM3bO1aLBWzKlpC01WfZLsm5hwrfBNlpdw5JhvcS77jDvgyisJ Zv03u4sE9WujTfZpr5LJDZyL/cGIBLTFqI2rgY2gzlrKw4iPZ/GjQcErpxKSWtZiUW8X m8BdgOPis3+lgEYlvAV2q/9k3XtJBcJ1/EOeygRS51F3Nws58xPUyd9oSPGGGNUUe3lO TCfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=edf2YE6tOjy5o639pmoNCDDnqNTZQ8NPmup4HBvbC60=; b=EvnInMwEDZkyGDiFGNjOZGuZ2dnkzJAnIiF9wT4leIwfqKBvnJ1rJqsFXHXv6rYM0U XAzgzt5yjTPamOP+nus/m90E0BBWqIBFXCpd6kfB5VDQ6lJceLHDlT78vLtDq3t6s0l8 M0+PV/qqMEJF5gytLaMmKCWbui6AF20ZzH3tiyy7orCtZa6/c26pHhs89U0wUd76S6wb 7m8ASOAEJk/JEaxx/EfvqM+xJQCYalTJRbgVIMqZcCxpg0tt0beH5Ejz5YM26D4oT3aT cRLXP09MbrY1aOAEIo8NTf7lCdi72DNAooTkSoO1Vmh0AVt70R2U+aGCqjc0IXcD+mcz x8Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=qBKmlBP0; 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 a3-20020a63e843000000b0051ba9b9c3f3si6577876pgk.321.2023.04.23.23.04.12; Sun, 23 Apr 2023 23:04:27 -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=qBKmlBP0; 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 S230519AbjDXF5S (ORCPT + 99 others); Mon, 24 Apr 2023 01:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231376AbjDXF5L (ORCPT ); Mon, 24 Apr 2023 01:57:11 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7535D3A99; Sun, 23 Apr 2023 22:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=edf2YE6tOjy5o639pmoNCDDnqNTZQ8NPmup4HBvbC60=; b=qBKmlBP0RbumDgdRWERGFEVbSD kDf8Kr5lk5aB2+nWak9xt17TfHD2PupAuPb1mUJmwaPm/dURvhYPVWSPaaOFCU9vr679O7rjTbCXX FY14jwJ6foFME5jmhn6hiaV5cvLy3w+4wiA9HOCqY9FKPUwzVOJnoZoumJfKXe+j3dCSf+I4DhyyN meS9IcfszZYuw8bakpryb8WeNnXvLqGFAShnlXlum+ZdAx1uWAgWfJ88JFAJBehhF7KCT0OC/pGsx saWH2fGCCZFbpsAwVDoLKGMeyxz9Qo8euhIsqOiC8WZE42QMSALorud5SvHI394LQ9T2HdWzjtMUM uj/muRvg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pqpAv-00FPys-1e; Mon, 24 Apr 2023 05:55:45 +0000 Date: Sun, 23 Apr 2023 22:55:45 -0700 From: Christoph Hellwig To: Dave Chinner Cc: Luis Chamberlain , Matthew Wilcox , axboe@kernel.dk, 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> <20230421223420.GH3223426@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421223420.GH3223426@dread.disaster.area> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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, Apr 22, 2023 at 08:34:20AM +1000, Dave Chinner wrote: > > > > - return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE), > > + return bioset_init(&iomap_ioend_bioset, 4 * PAGE_SECTORS, > > Yes, please. > > > The shift just seemed optimal if we're just going to change it. > > Nope, it's just premature optimisation at the expense of > maintainability. The compiler will optimise the multiplication into > shifts if that is the fastest way to do it for the given > architecture the code is being compiled to. We still had cases of the compiler not doing obvious multiplication/division to shift conversion lately. That being said: 1) this is an initialization path, no one actually cares 2) we're dealing with constants here, and compilers are really good at constant folding so yes, this should be using the much more readable version.