Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2811458ybt; Mon, 22 Jun 2020 07:37:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfaTpHTQpQak4XDJDjYAdJxIDTOjDldiEXmVAvRzNRN6boeNN78RnIj/hko2NloSGJuScy X-Received: by 2002:a05:6402:1614:: with SMTP id f20mr5851920edv.129.1592836658213; Mon, 22 Jun 2020 07:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836658; cv=none; d=google.com; s=arc-20160816; b=qvE0t9dDE5mqflPITUvgfDOmSHPfP0qUIQLzVfDpnqndjkQj/NvB6WMQZyiJPpOBx3 nR7TamXa9XFR5n90THC2ZBew5LVRuFYbAuLQk5oM4sVH1RiFQGWDOaV9XZiS68Zzz7HO aA28yRnDHOQry9K+AgM5U3buX682QrwTfcAv6Esgdki40VPInN8AL350Tk9qwneGlUJR JN1rgFkfR0fcnJ5cCY95KIGowTTAh5vfdZ2smYspg6vvJG95B3Qd35YlXHmlBzdp7KPb RoGLkaAL67nUsxdB6sLHckts3byEx35q8l+MEKooaAKhyZUOBoqEcm8fOo3jmTRpswTz lvVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=m8LciREWJsj9AQY8WoqbJEs9+BzHuuZ2kYt75+dmYbI=; b=cZKAdZA/8lf0gPJj+BXjZ60j5/B19Q5qhiOnxmsBXJguKuk7lbo0tDdY8oHD9w+f1E nmDV8gSJ2YrXsCuHJIr7onwv+TpMyDaIaRAFX5gFpjPp4mbfUYJEmg35C1jlZ9J5eHYW itJOjaeHmmF0ZjBkB/LxEfJric11Hus2LB/dl6mRqI2/ItbA/GFWK2iftG10fQ+oiCzj E+FYkNFFCo/Qsm5lsnD86TsY6ZMgyW2tOV4ORSlRWT/+WM+xPWI7jMnIPSKG0N36NFmL YT1Q8XgntT2Z2Bdz1rymStG/BubpFagp/EBITHUwwY79PzDzoGAsc5v8H5cWD3gQI7ru Lxww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hqma2vVQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id np3si9643431ejb.144.2020.06.22.07.37.14; Mon, 22 Jun 2020 07:37:38 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=hqma2vVQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729086AbgFVOfV (ORCPT + 99 others); Mon, 22 Jun 2020 10:35:21 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:34764 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728504AbgFVOfV (ORCPT ); Mon, 22 Jun 2020 10:35:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592836520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m8LciREWJsj9AQY8WoqbJEs9+BzHuuZ2kYt75+dmYbI=; b=hqma2vVQ6GbNxolpthJP8wzThywsuwO2g72qG5AhqMyTrJWTLRtN1croR/l1QMy6IF4+rh JWC0gQBarCkLRmFOsNzV49EQ0Pm2LPT8Sqj4JDRX4SqfUP2c3AFLZFj1SEHpLLuaV5DAmx C55MxWNDxHG4iQmzA7us75A6mqCrtTo= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-495-A8iKzda7OoGKvcY0HYwSHA-1; Mon, 22 Jun 2020 10:35:17 -0400 X-MC-Unique: A8iKzda7OoGKvcY0HYwSHA-1 Received: by mail-oo1-f71.google.com with SMTP id v9so8694100oov.1 for ; Mon, 22 Jun 2020 07:35:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m8LciREWJsj9AQY8WoqbJEs9+BzHuuZ2kYt75+dmYbI=; b=D4XXJ6TQ8cnjwShKUCfijFBnwao6U40lEhLxMBBsJpNiPK9685x6Dq/CD3DR5bQUhO 2qlTzdyhmBieBLsplUbYjocjBg+X6E5PrhVaUDZdx2nAvBIJRXJ6Y22rb93c8j+MpIKy pV7dpzZpKADcfXRaARamTHqNIo2eCfMFEvVKbHvmVG80vKpAo4hCltM1j4tab1brP9Xn /R46b++n+RT+M67x7GC9k8xnvRpbpa4AHTd6LGrGnDNtyfVOR6Z6xYfi2jlybYb5boqj wnDLvEQJpF/ss3gVAunJiljQcpjR7djHufFxk1Q3920ox2Fm6RkJTq7YjOogBMVmPQ1K o8hg== X-Gm-Message-State: AOAM531Xx7N7Ldf730txsWmB17Lq6DiB9eNVyUy3LKLyBXEWNXxqVnUz +OTK+xCvfN1ohA1r/sWJv8vgkYT1lqX75NDsp+GpUpx6Azm8q1lcnVQfnSG5ib7nf2X7N+koSw+ XY+TQ5kMG/wWf1pcDqxkYb0eONZvkrl6FnUCqpRAk X-Received: by 2002:a4a:868a:: with SMTP id x10mr5394720ooh.31.1592836517114; Mon, 22 Jun 2020 07:35:17 -0700 (PDT) X-Received: by 2002:a4a:868a:: with SMTP id x10mr5394700ooh.31.1592836516902; Mon, 22 Jun 2020 07:35:16 -0700 (PDT) MIME-Version: 1.0 References: <20200619155036.GZ8681@bombadil.infradead.org> <20200622003215.GC2040@dread.disaster.area> In-Reply-To: <20200622003215.GC2040@dread.disaster.area> From: Andreas Gruenbacher Date: Mon, 22 Jun 2020 16:35:05 +0200 Message-ID: Subject: Re: [RFC] Bypass filesystems for reading cached pages To: Dave Chinner Cc: Matthew Wilcox , linux-fsdevel , Linux-MM , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2020 at 2:32 AM Dave Chinner wrote: > On Fri, Jun 19, 2020 at 08:50:36AM -0700, Matthew Wilcox wrote: > > > > This patch lifts the IOCB_CACHED idea expressed by Andreas to the VFS. > > The advantage of this patch is that we can avoid taking any filesystem > > lock, as long as the pages being accessed are in the cache (and we don't > > need to readahead any pages into the cache). We also avoid an indirect > > function call in these cases. > > What does this micro-optimisation actually gain us except for more > complexity in the IO path? > > i.e. if a filesystem lock has such massive overhead that it slows > down the cached readahead path in production workloads, then that's > something the filesystem needs to address, not unconditionally > bypass the filesystem before the IO gets anywhere near it. I'm fine with not moving that functionality into the VFS. The problem I have in gfs2 is that taking glocks is really expensive. Part of that overhead is accidental, but we definitely won't be able to fix it in the short term. So something like the IOCB_CACHED flag that prevents generic_file_read_iter from issuing readahead I/O would save the day for us. Does that idea stand a chance? We could theoretically also create a copy of generic_file_buffered_read in gfs2 and strip out the I/O parts, but that would be very messy. Thanks, Andreas