Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3810186pxu; Wed, 9 Dec 2020 00:45:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwx5P8nmQXT/qQI+vvUBDoLRIzl144hopMHsQQf8aiLFJYB5uxgdYTcbPIK09/wha5VeAVf X-Received: by 2002:a05:6402:1ac4:: with SMTP id ba4mr967943edb.383.1607503507837; Wed, 09 Dec 2020 00:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607503507; cv=none; d=google.com; s=arc-20160816; b=STCHPJ/oAXckKRIaakfY4KfSZ4rio7b3FWAQUvaIoef10ypoM1Z34qY42sUSZXmZ9w tq9C7cJY53MoQ8OgF0jnSxJaxWcwthRqxNPIT3L/iRTC4eFxOKRruavdZUiqMymMCzl9 vUXH7oqv7hEM9ci5pjNV/R/xvMbiCTSIBA4levNYLH73OEXxKg3ro+25YK5mKK3CHUw6 k+VokAZk9oe5C+UF/Qc2tyVR+yOsB1K3lqcB/AcScsahExxrTfG3QaD6h7YSUOj3VQ8h NtPfGNQfEHsS4a6xIOOfBBu839Knz/Z/0mwgcfCbxovjXNCT/2r46Bmz0gseMVkp2cJN WqkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yQKPtpXCASkE2tUo7CFKOoPdXuOQe2z1SqQtIjAyMlE=; b=pjyBHMwxkO8U9TYf08jCfS+IJxaKaSq/Rz+uc0enFj5zwcc1jqPTvE8FkHTQdYxyG4 fROtgd6nesjfcF2qZnDJhNGS9bEkeV1TzQpNLkzojwYT4m+UsV1XC8G+2SmU+SIP4E8W xXUw2mqcgEf5PO2+3maWncU1F42sQQgnEwYOF4EkVrzsAWSNRB2rtv07ClNgIcSivJEa vCKXR9I4NIP2SstS7gD04Dl9IhW0E7OKaEatsfct8cB2TCXAAWX1PE5DgPETeVBtTd71 0X6WmCPOZ4V8o/ewbnAf8/8FOmqcOJtPr31Z+gU+9mtxuVSswE7j81l/2lvNalRxl8xw sxqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=AcdhD7xY; 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 hr6si428174ejc.319.2020.12.09.00.44.44; Wed, 09 Dec 2020 00:45:07 -0800 (PST) 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=pass header.i=@infradead.org header.s=casper.20170209 header.b=AcdhD7xY; 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 S1727800AbgLIIks (ORCPT + 99 others); Wed, 9 Dec 2020 03:40:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbgLIIks (ORCPT ); Wed, 9 Dec 2020 03:40:48 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C0D9C0613CF; Wed, 9 Dec 2020 00:40:08 -0800 (PST) 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=yQKPtpXCASkE2tUo7CFKOoPdXuOQe2z1SqQtIjAyMlE=; b=AcdhD7xYdQ9N6uRgqFgFDm1ma+ 8im5Py0culOZnMkJaqIt1VWNAqmGBvF6IpOh/bNOhVmhrQi4HjTDGDGVcech4VWQmRgQgiwgn0K2U nAobRvRF0H/zry9vV0HYDA0q5z07rymIO3XlvIt3FzNCWQoOTjrO+8LysWexJ0psADmKULChmGSfI EG5FhpuC4O0tUCafbiA61hqTA/drvaEvvvpGxNLC5p3fsnSQhf5u2rO1Ivw9+gZZA0tIeiHaot6Rj WoGki88wkgRts60nR6RvLCYFaw+dlGNkzpQJH0r3a8qEZp1cja8OsdVCxS1lwr+5mxKY514XoVcKg hNfdYEmQ==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmv13-0006Ij-Ig; Wed, 09 Dec 2020 08:40:05 +0000 Date: Wed, 9 Dec 2020 08:40:05 +0000 From: Christoph Hellwig To: Pavel Begunkov Cc: Jens Axboe , Alexander Viro , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Wilcox , Johannes Weiner Subject: Re: [PATCH 2/2] block: no-copy bvec for direct IO Message-ID: <20201209084005.GC21968@infradead.org> References: <51905c4fcb222e14a1d5cb676364c1b4f177f582.1607477897.git.asml.silence@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51905c4fcb222e14a1d5cb676364c1b4f177f582.1607477897.git.asml.silence@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + /* > + * In practice groups of pages tend to be accessed/reclaimed/refaulted > + * together. To not go over bvec for those who didn't set BIO_WORKINGSET > + * approximate it by looking at the first page and inducing it to the > + * whole bio > + */ > + if (unlikely(PageWorkingset(iter->bvec->bv_page))) > + bio_set_flag(bio, BIO_WORKINGSET); IIRC the feedback was that we do not need to deal with BIO_WORKINGSET at all for direct I/O. > + bio_set_flag(bio, BIO_NO_PAGE_REF); > + > + iter->count = 0; > + return 0; > +} This helper should go into bio.c, next to bio_iov_iter_get_pages. And please convert the other callers of bio_iov_iter_get_pages to this scheme as well.