Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp275175pxa; Thu, 27 Aug 2020 01:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1WIcyJlmiaoZYIuN+nJGj4E/Xn6JuzkuTHQpHLh1o7jU2iRZw89MSDdcQP/V0UkX4g8DF X-Received: by 2002:a17:906:2542:: with SMTP id j2mr19175800ejb.442.1598518058517; Thu, 27 Aug 2020 01:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598518058; cv=none; d=google.com; s=arc-20160816; b=xOHgh/AkI1FW9o5XEtwRX9mXyNL41bAtGaZjnkwbBMGzgdgzd8QIvbB76iLFoBwl7+ uq4w+jzCJx80mz4mKHiNL1nhdSTREsAjRjnAOGWOsNMEvtTIXhATVvr1eKzh91oTkQlJ G9XNjXNWyMOC3nFBZemXr+hSXow2bp9QRJEaRsf/3zkdM+16rqYmJyEzMbZ9iUuTmy4l xt22BxOFbJA5Tz55XDC9lRNTpIupBaleXRnnK/k6ikqijOWr7ssWnQq2tI/SWndXLKKM vAVOWdQLsK07YhU1ESplfGRO6RG4RPohJR/lXhle79Dv2UFDinUqvp3FWlzjQpfIJ7+7 GCYA== 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=XCNfEIVVuEm9Nii0PBLcxslSyiHh28f54cDTYv6Ia/I=; b=r3vtHTkSi/IaJDaiIMFd7O4IN7tqWvnXbzNdGfx8lURBg/6vU0Ym8jazIu6zRigxGY eZ/wcuPMFwiPMoeHJYqJtKvZWe5AOdVnY+I9Kiw3jOLak6TjjEdkJPvsp8Whzl24VbDR FqL73JZ+yVYusu+oqKw71vid+IAy74XT4XgrBfHcBLKivDtXIcno20OCF9UWWVXeyjaH Yzli2dJCrb7Px5BWK7IlvLVbla535LZP8svDy5C9aZGOtCKQSvRedNZMAkuIXWJOMVj+ tQ+xSOSGSfCVkLHUnq/vc+hSFi6jpMcZEbUuHkakDHQICui1/9PqwoTUgKodM0SiRRCH u6Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=myVpZlgS; 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 q11si825778ejb.101.2020.08.27.01.47.14; Thu, 27 Aug 2020 01:47:38 -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=myVpZlgS; 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 S1727999AbgH0Iod (ORCPT + 99 others); Thu, 27 Aug 2020 04:44:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726938AbgH0Ioc (ORCPT ); Thu, 27 Aug 2020 04:44:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4F5EC061264; Thu, 27 Aug 2020 01:44:32 -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=XCNfEIVVuEm9Nii0PBLcxslSyiHh28f54cDTYv6Ia/I=; b=myVpZlgS5AxWgCy47srlPuWNAT WxrcwoebKp2asNE7Jh3DH0HA8gcWt/25m22bDVLeKU4uzkCFKbraCqIJJuWv1uHiXpn6ARuq9rPCL fBLdrk3IbGTC+5Naqkas+u8sBkr39za4lSKkEmHictQpXTHJxLwnEKopFbz0x4ThiIsAj6gkc37C5 tqm1Vvw7ZOiZCjOCu+/FHuchbdMcMmelFpO+E1wvnfghYdlDBrU+TVyp1ppdMll29y78lGr7dAVpA aJy6lpPD7M4HMh8g9dWgu2qKWV2d4mxYc99l9VBZzNrvQ7uexcOdwWWFAZJVkcVZaeBpBIOgOsioA ndKhqjxg==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBDWJ-0004Gq-4P; Thu, 27 Aug 2020 08:44:31 +0000 Date: Thu, 27 Aug 2020 09:44:31 +0100 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Darrick J . Wong" , linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/11] block: Add bio_for_each_thp_segment_all Message-ID: <20200827084431.GA15909@infradead.org> References: <20200824151700.16097-1-willy@infradead.org> <20200824151700.16097-5-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200824151700.16097-5-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 24, 2020 at 04:16:53PM +0100, Matthew Wilcox (Oracle) wrote: > Iterate once for each THP instead of once for each base page. FYI, I've always been wondering if bio_for_each_segment_all is the right interface for the I/O completions, because we generally don't need the fake bvecs for each page. Only the first page can have an offset, and only the last page can be end earlier than the end of the page size. It would seem way more efficient to just have a helper that extracts the offset and end, and just use that in a loop that does the way cheaper iteration over the physical addresses only. This might (or might) not be a good time to switch to that model for iomap.