From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC946C433E3 for ; Thu, 27 Aug 2020 08:44:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A24672074A for ; Thu, 27 Aug 2020 08:44:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="myVpZlgS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A24672074A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3CFF96B000C; Thu, 27 Aug 2020 04:44:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 381BB6B000D; Thu, 27 Aug 2020 04:44:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BE436B000E; Thu, 27 Aug 2020 04:44:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 16B596B000C for ; Thu, 27 Aug 2020 04:44:37 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D9648180AD80F for ; Thu, 27 Aug 2020 08:44:36 +0000 (UTC) X-FDA: 77195712552.14.hate06_0107bab2706b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id AC9E018229818 for ; Thu, 27 Aug 2020 08:44:36 +0000 (UTC) X-HE-Tag: hate06_0107bab2706b X-Filterd-Recvd-Size: 2556 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Aug 2020 08:44:36 +0000 (UTC) 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 X-Rspamd-Queue-Id: AC9E018229818 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.