From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66FC17C for ; Mon, 24 Apr 2023 05:55:51 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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.