Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3296641pxk; Tue, 15 Sep 2020 15:44:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIiD1TC2Xvry6+qEcLg1F/tGX9Ye+YfddiG598E18DV5QqIIKEygX6Y+5dfknVGZQsfT0h X-Received: by 2002:a17:906:2985:: with SMTP id x5mr21977257eje.136.1600209883576; Tue, 15 Sep 2020 15:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600209883; cv=none; d=google.com; s=arc-20160816; b=SXG0OniUXYoi2UqX1/cx7gdDL1eLsXcXyWpZybp+a5oSok5CJcWdgX7ncetF1E9dTc P4e2lsnw8XdDljMH68tR1GnQ8ltXPwd8oOGn6b09ept/Sr2/CKCdW7BhQcUTtLJi58IR 6pE6gJ83pb5LOvq1ec6Tb/MOe9QeUcI/59Xi+C7KGVmYvTD6cHQNH2Aw6eK2/+MhT073 DFOvXtkPp1dYVyaOlVvk9Yp8GO/aa6ze1TCI/kUGBsT5FTKXAWsH5vNIOmX2zxtt8muG a7/jPiAoEbxmkjfzzVL0/hlIcxapWx8vtEBoOnu6dVnBAR8ZFJG97veO6maXDqhd/FzO JsQA== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9hpqrM0yq5Ww64iJO3HcA4+NwEdTQm35KV/P4mwZVJ8=; b=xAL47hHEaossVs7HYWCVsIAwY7Ly5MzFoQXuYXlXqcTGN6tNGjQHdXR/peSK/4O0mv gTMemuRb/jmw1l7H2FEe2BzXxdlaDusCAhCIdVAuSlbPKJPN3u69cBUmk3ywMa6nCmSQ r51sMkBLB2N0P5qhGiZt7h8GqxdF0crUWBLklVUHFQNQsXDCWScvECv1shF01GIBCnAd uPQCV5VMdqyLvd395S6qIhUYL03mmkki+/OYmUxBL2NqghLyBismGP/6r9JcN5uf+5pd YXVdr3kDqaKS9qYxxl3rdMKUe4zovq7AWTI/9M5YHGbXdMCintVzs1dr0r/jdINBauOG rlVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Ld8EqgoT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si10634866edr.568.2020.09.15.15.44.21; Tue, 15 Sep 2020 15:44:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Ld8EqgoT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727776AbgIOWlc (ORCPT + 99 others); Tue, 15 Sep 2020 18:41:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727396AbgIOP5x (ORCPT ); Tue, 15 Sep 2020 11:57:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BC9EC061351; Tue, 15 Sep 2020 08:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=9hpqrM0yq5Ww64iJO3HcA4+NwEdTQm35KV/P4mwZVJ8=; b=Ld8EqgoTHdhtpXDolfkH6H8955 WruBG1aYD6Yzgd0KGMn5LG/XdiTjqpJayTXIZJPGsHoO2OlPUygq7PKR6gJflJxy6AAhgs+gwnrD4 gwA4p82nbFgJxHk51dAZBJ3pomaao852oedeL5oJlv/N8ObKdMjc2T3MOu7eyjYQdjWU0Yrnkx9qB CGP7Kj91TJbLimXQ0puCBDNC0OxZGlIVJEvC9EFoIfiMMjlFX7gMOjBw+lO5Y20877/EWw4k2hgG6 Asf3XkrMLaNfUI7U8J0+RAyqsP2J62ZETQcXEChi6hharp4fYKPNuqrKvVqCItl38spq9NmXSuOV1 H2ZJ6fRw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIDDB-0002uB-5c; Tue, 15 Sep 2020 15:49:41 +0000 Date: Tue, 15 Sep 2020 16:49:41 +0100 From: Matthew Wilcox To: David Laight Cc: "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "Darrick J . Wong" , Christoph Hellwig , "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" , Dave Kleikamp , "jfs-discussion@lists.sourceforge.net" , Christoph Hellwig , Dave Chinner Subject: Re: [PATCH v2 2/9] fs: Introduce i_blocks_per_page Message-ID: <20200915154941.GJ5449@casper.infradead.org> References: <20200910234707.5504-1-willy@infradead.org> <20200910234707.5504-3-willy@infradead.org> <0c874f14499c4d819f3e8e09f5086d77@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c874f14499c4d819f3e8e09f5086d77@AcuMS.aculab.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 03:40:52PM +0000, David Laight wrote: > > @@ -147,7 +147,7 @@ iomap_iop_set_range_uptodate(struct page *page, unsigned off, unsigned len) > > unsigned int i; > > > > spin_lock_irqsave(&iop->uptodate_lock, flags); > > - for (i = 0; i < PAGE_SIZE / i_blocksize(inode); i++) { > > + for (i = 0; i < i_blocks_per_page(inode, page); i++) { > > You probably don't want to call the helper every time > around the loop. This is a classic example of focusing on the details and missing the larger picture. We don't want the loop at all, and if you'd kept reading the patch series, you'd see it disappear later.