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 C7DF63AD52D for ; Wed, 26 Aug 2026 07:35:40 +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=1787729744; cv=none; b=N9NBj4PIJIAokk5DTe+5ArTYm7awOq+TlrAcC0Vt8edXq17I3QFFPqHMI3lxr9tbE2MeARXWgED3Gx2pk3XS2F0rOVSW4H/vrUgLFVHpGdsAy/mF+CQKXh7IjgOdAE+bevrJpUVKxcCGtjNkrx4HRFNKdAyRBVF9fayCZ7z2sCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787729744; c=relaxed/simple; bh=qnqUE9PNYF7BP1HhTCBiC3PS1WnzY3ekpgqtcBDeNDg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Aa1VBzIUUhoDLK55yIRFYJPgOtoGtcL4msq8k1TntA3bT1WXF0H8bJqaadxY0Om3BvSVlyppWoVCo0L3TVkvW1P0dFtHfy//E4e8+1hJrCzpN9y9ifTXH5BmwRTX1xqUNNCp3U3Y6m02OvfuQKI5zdI59NBez1SbCHAya8YpVv4= 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=JddnPsIT; 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="JddnPsIT" 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=IPRq7wCujCDeIBCoHVvXJ5nm+1AbLLNDAy2xmgNZTnE=; b=JddnPsITM03lHqVUsASwTa78sr sQPeEVy/iyIcUj1u7ZhEGjndPuTekg40dW/K9n9qyFIr3RolTqKuY3jsT6Lil3oMbp342RR39Lm9D RgHNVyc+mpUwtjCfEvMCzuptbea7GBYjEjJkvXevoAG4TQOXoEBMlxKwUv4jI5taXErm7E3yeh2KH snVNNaSIKmHvDBfdMbQZzVm3d0oT5Ya2/Kkz/VlXlbctWPQ/4o6Cp/v8TgOEWS8T6YJ/j78vXngZL R2tJhN9imjgBHJM9eDH98xAVIT03D0VgWLJlP8J8gaLxjDbn/Bsut9jaEZd/ccckgL+EkgZTGf07r c/B3L/PA==; Received: from hch by bombadil.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1wz8Ac-000000021CP-31ag; Wed, 26 Aug 2026 07:35:38 +0000 Date: Wed, 26 Aug 2026 00:35:38 -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=us-ascii Content-Disposition: inline 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:39:14PM -0700, Christoph Hellwig wrote: > 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. Also in addition to reducing the calls to pin_user_pages_fast, it also removes a fair amount of work to recalculate the bio_len in the get_contig_folio_len loop in iov_iter_extract_bvecs, which has shown up in profiles (although only marginally so).