Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp586516pxu; Fri, 11 Dec 2020 09:19:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhngTESG7b7d2cqjx8G1hc81zzpgCEH4lTyersxA1RskhhSwKIWgIYLiyD7WQze27bdor6 X-Received: by 2002:a05:6402:2066:: with SMTP id bd6mr12828564edb.211.1607707165592; Fri, 11 Dec 2020 09:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607707165; cv=none; d=google.com; s=arc-20160816; b=eoHfhl1ooNxqisEljvGdwxshP1KXe8bdi2STnBAONrfTetQ+/NWAtwVznVm/9aY578 tdH6Bmp4WYi2JXtuZm5OokvU2rgc+k6CmJgmFDFM9oBtZp1sLjBsLK3moxpG5CSdOHYw yLw2BhrK7M81ad5OKu31zoE35oGsM8hI7swQgnVz3fK1pjQt8L08TcZjdWIzRjzhFaF1 EilaQlboLtYXvbaUneu5uoXibAr7N9L7DA03KIY7AYmBvnRO6MOIAl53TugqlGcWeLl8 neu9rmmnvOmLKDyqEwszN1RGgpZZPXJ0+lrnRTJ2q1AtaePTPmMYukdHLW6h7iYLTJpH 5RcQ== 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=aF3Mh+MA2q+ZpkL8xg5nd4+KjM1FTv7S2GkjkszOwBM=; b=FtvixA8wVtlO0EeQzygCYLCqCuItbx6sCQwYwCYFxbOeQmgjQt+fbB+8H2PgT2P9b/ uhhQF62tXYY/2ImKpRShbZLIcfT5sDqA9fsuqiu/O6+J1bgRak14pj+JK0xk/LMuh8Ea nPyAZLaCigeTR13ykjXf6kC3CVCKIt8RszJh18cSDYHm8w3Urk8K5sZ11Ucd6T1JnXuo I+1ylPLmJsu7EG4GL/3oozrluo4WpNzLOgipjQ6F5iSW9agQqmKB4Ug7sa4foJyo9i0f uZkGL5ye6DjkkYoSsSRpuzfZLylqB9sfYVqLxqIW6zl3+rRZDbIcEgmHKaP0FhNKE3LA 3vxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="i6YXb/kx"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg30si4924601ejc.353.2020.12.11.09.18.59; Fri, 11 Dec 2020 09:19:25 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="i6YXb/kx"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391753AbgLKOJq (ORCPT + 99 others); Fri, 11 Dec 2020 09:09:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390916AbgLKOJh (ORCPT ); Fri, 11 Dec 2020 09:09:37 -0500 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9E11C061793 for ; Fri, 11 Dec 2020 06:08:56 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id a16so12506882ejj.5 for ; Fri, 11 Dec 2020 06:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aF3Mh+MA2q+ZpkL8xg5nd4+KjM1FTv7S2GkjkszOwBM=; b=i6YXb/kx1K+ZBNheDvASX0oKCecbflSu+fyZ2fjKhwHBwFR4vTEmwXKgPT0qc764hc qewaFUeRaEtQMg4y/IoQVBFWvYZgkKHgyPd0hX4njbbbc7ZIqLfu5zOpaeWkQf9WL/YY gK4YXTSVzLt6ykV4YXpOlzQE2kLyT/GEE8ZicFgOtOByVhSdmNRn25qGctI7sVs67bMM g71vZ5z1eKErNtAJkJsFWO6CAtctbdgFlqO3i2yYIu2B89QgS0bwMVUcc7u83MGSWI/p irIp0IQm6+JQBAc2JE7Gcyj+oiIYQTctJxugvD6aHDhN70KKyCr4Vg/HLjfLLlUIbrcR cO5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aF3Mh+MA2q+ZpkL8xg5nd4+KjM1FTv7S2GkjkszOwBM=; b=I6j8YmnW2gpJzR1mHxbSNdYYR3VY0jheBp2RsihpEoCwBTeX+fI9Cw1rBcE0VuuNdV x4rK8aVnF/F8+cz2ODZzuKtyLsxikEJKj+rE3v8CKz76tYTRBNqiY/L3SIxfvYhP23tT muwjjnPuG1bDYSbhNogBfDgrVQKufDPNA+JxhcdUN6WgBan2XlPWRPcIq8OKSH50GUyI /su8FaTtJZEGABSjI9rry2W+iUiQ3CsBrwEkaIFBd8f3sYdYBlYwpeO59cOxWX6K7lKx OLLOSR15j3GNMZ1dIjZp7EOaK2p9sYfV36JXxhXSLvp9iIAXENC0CKyXluBWL6J2bsbB TQ6A== X-Gm-Message-State: AOAM5334j5C7U6oGW5Ttu9YawX1l0RjwsySygd0z9qVAH5KxchXH54kH jFYjK7SjrBPwfUDY7FQ9mOe5iQ== X-Received: by 2002:a17:906:a244:: with SMTP id bi4mr11127201ejb.59.1607695735452; Fri, 11 Dec 2020 06:08:55 -0800 (PST) Received: from localhost ([2620:10d:c093:400::5:ee7a]) by smtp.gmail.com with ESMTPSA id rs27sm7106637ejb.21.2020.12.11.06.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Dec 2020 06:08:38 -0800 (PST) Date: Fri, 11 Dec 2020 15:06:22 +0100 From: Johannes Weiner To: Christoph Hellwig Cc: Pavel Begunkov , 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 Subject: Re: [PATCH 2/2] block: no-copy bvec for direct IO Message-ID: <20201211140622.GA286014@cmpxchg.org> References: <51905c4fcb222e14a1d5cb676364c1b4f177f582.1607477897.git.asml.silence@gmail.com> <20201209084005.GC21968@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201209084005.GC21968@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 08:40:05AM +0000, Christoph Hellwig wrote: > > + /* > > + * 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. Yes, this hunk is incorrect. We must not use this flag for direct IO. It's only for paging IO, when you bring in the data at page->mapping + page->index. Otherwise you tell the pressure accounting code that you are paging in a thrashing page, when really you're just reading new data into a page frame that happens to be hot. (As per the other thread, bio_add_page() currently makes that same mistake for direct IO. I'm fixing that.)