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 CBA342D662F for ; Wed, 26 Aug 2026 04:39:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787719167; cv=none; b=hCgQ+GIc7/9RkukTDd1OvO6KtjIEmz4x8EUsJ/TN7SrAZ3Vnl2aVQSuxmSXrbj6Zi0Xv0rrWSIkowRLfVrYkKwx2uSw7OvTE/3QJfuWZvMTpcOtbxNF9tuQ550RE7JzbOYYPWMhPqt3KnvRgoW/018KmHhK65ki97LBJCRusxrA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787719167; c=relaxed/simple; bh=pCvRj7D6WVOUdZmWBEXupQeyVHKS2Bmp2zCS6TOVSk0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NOR+XF/FDByfKzprL6vprPWvZxwWDKhTqEW9n15Qq5SCG52msA9dWKxwhmDtf85xb6g0ILKbNacGWMGfj4jIy69aZQ2zoLe6Lb3zsePiPYQ86kXZ3IzDMwNNC9DQ316GZnov6IXyIMtaYnAVeBqrFdy3HJbXn4bhfcXd2d1UOi0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=uAZQOpGq; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uAZQOpGq" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=41Rt0vAQEaJmrkrfwUslbqo+28BOf48xV3lYK1P5vZg=; b=uAZQOpGqaJIyDd3J+r9WlB7Obz wJdFDpGyGtfYjCcU1Xr5M86W5pupAvOwisRVvGpjDsHhp02aw7zw4hMb2P2rjKoAYDR3krFz/rlDv 13i2f8YKpurLuzktnuurtgX+bnfuy5sQa54CmDIPT2g/2sTWLUWI17Lt8CDuHUSDf5lUBMiHIPius bYPxgFWjijeSCQ2XeLxHF30YHQqbI1YLPHufVDNY5fNOGRUmANo6yHJcowjqFbt3AUWuUYjue6fBI iyto6yWbbL/psPXFmN5vSH1IRp6Uk7inpBarOilnFJloUWRlMIuLgP/URXOX2rfl8Iet/LBafvWpW IQY1YMyQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1wz5Pu-00000001tLh-2NRV; Wed, 26 Aug 2026 04:39:14 +0000 Date: Tue, 25 Aug 2026 21:39:14 -0700 From: Christoph Hellwig To: Rik van Riel Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, kernel-team@meta.com, Andrew Morton , David Hildenbrand , Jason Gunthorpe , John Hubbard , Peter Xu , linux-mm@kvack.org Subject: Re: [RFC PATCH v3 0/8] batch lookups in follow_page_mask() Message-ID: References: <20260811025157.1632867-1-riel@surriel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, Aug 25, 2026 at 09:37:09AM -0400, Rik van Riel wrote: > > And what many including the most performance critical callers want > > instead is really a single bio_vec.  Maybe we can go the extra step > > for > > that, as it would reduce the number of calls into gup significantly. > > > Which code are you referring to here? > > blk_rq_map_user() seems to end up calling pin_user_pages_fast(), > via iov_iter_extract_user_pages, and it directly fills in the > bio_vec's pages array. > > Is there another performance critical path that goes > through the slower get_user_pages() path? The other callers of iov_iter_extract_bvecs matter more, but this is the main user. And iov_iter_extract_bvecs right now is very inefficient when used on larger folios, as each call to iov_iter_extract_bvecs and thus iov_iter_extract_pages and iov_iter_extract_user_pages can only fill in up to 256 pages. On x86 that is a single PMD mapped folio. Passing down the bio_vec array means that for PMD-mapped ranges we reduce the calls into pin_user_pages_fast by a factor of 256.