From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A84E7C433DF for ; Wed, 24 Jun 2020 12:35:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6D59520789 for ; Wed, 24 Jun 2020 12:35:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fjKFCk1+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D59520789 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB0516B0008; Wed, 24 Jun 2020 08:35:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D10FC6B000A; Wed, 24 Jun 2020 08:35:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB24C6B000C; Wed, 24 Jun 2020 08:35:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 9BF616B0008 for ; Wed, 24 Jun 2020 08:35:55 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3A54C180AD820 for ; Wed, 24 Jun 2020 12:35:55 +0000 (UTC) X-FDA: 76964052270.29.pump29_2e074c626e44 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 0982318086CDD for ; Wed, 24 Jun 2020 12:35:55 +0000 (UTC) X-HE-Tag: pump29_2e074c626e44 X-Filterd-Recvd-Size: 4479 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 12:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593002154; 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=KXOd3FWsgxfpuN6FCKX2ClEKNWirNYpN+5hpadr6Dd4=; b=fjKFCk1+x9lOC33gDMhSKXA4zABmuovvtYo+ySHm7nH35qiUxzzPyLLWoTCZmOhBChgo6Q VChG21jR1DynT4ZV6SrXzW5QucO5hjKInJQsvAPprVjM8nOg32vd9ud3cTIYMmwCWWSfQ7 QcUteLsVntcd9sxUGFeCvkxxh0U0qCE= Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-338-qivWi0bJNLyUzi_Ki7xGxw-1; Wed, 24 Jun 2020 08:35:52 -0400 X-MC-Unique: qivWi0bJNLyUzi_Ki7xGxw-1 Received: by mail-ot1-f72.google.com with SMTP id o21so1312963ote.4 for ; Wed, 24 Jun 2020 05:35:52 -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=KXOd3FWsgxfpuN6FCKX2ClEKNWirNYpN+5hpadr6Dd4=; b=QNTGZD7JxsBU+ZfbnhYRVshpUQ0xg6LX2eJHss/axxVZFVvkhqpdiFwUKmHkl4fnWm oDuBXJUSh+fCR038a4PzYbr3RI/HnP9xbToCH30F3SA3Vzfvtfk27ein4WoPh74OemN1 2hHLS+tV0HA4S07bxYq7cup7bf8L4/Aq/WV4ZwjpSSqZDTzFsdAfjLY1eC/YISbmS9yI aAzFktPW1CImW5CQfpk5OV/p6A+DW2HImUSs0v5+41M9LUufzr+uiNOiRsJjphx6fBpb NHZD9sQCFrKfzP1OAcrX/Q81A78mZGQkqQdIreYQ0blKXU0o9KH76572eOxEizYOTZCB TWaw== X-Gm-Message-State: AOAM532k4anw6YXwj2rBjXItTT6QDaJX3x3Ey1d9KWagah4Ncs8wHcD8 yKhgcvItDxpJ6jDQO06GFZOoUqHjuzo2GAOvUf6uKk5AXph/GpzW9/RD87GddAw+i2a+vQkwQSX ArIv6Mk0J3UDv7pcgrPmcO0rdLAc= X-Received: by 2002:a05:6830:10c8:: with SMTP id z8mr20797121oto.95.1593002151761; Wed, 24 Jun 2020 05:35:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX1TWYnFwEpwDI3Wr6NaU8l9Igwlb4//wePGQRtnuC7RPWRAmd3PhYKW23yN302Duu4KI+Bsz7H4/6MJejzh8= X-Received: by 2002:a05:6830:10c8:: with SMTP id z8mr20797107oto.95.1593002151523; Wed, 24 Jun 2020 05:35:51 -0700 (PDT) MIME-Version: 1.0 References: <20200619155036.GZ8681@bombadil.infradead.org> <20200622003215.GC2040@dread.disaster.area> <20200622181338.GA21350@casper.infradead.org> In-Reply-To: <20200622181338.GA21350@casper.infradead.org> From: Andreas Gruenbacher Date: Wed, 24 Jun 2020 14:35:40 +0200 Message-ID: Subject: Re: [RFC] Bypass filesystems for reading cached pages To: Matthew Wilcox Cc: Dave Chinner , linux-fsdevel , Linux-MM , LKML X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0982318086CDD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 22, 2020 at 8:13 PM Matthew Wilcox wrote: > On Mon, Jun 22, 2020 at 04:35:05PM +0200, Andreas Gruenbacher wrote: > > 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? > > For the short-term fix, is switching to a trylock in gfs2_readahead() > acceptable? Well, it's the only thing we can do for now, right? > diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c > index 72c9560f4467..6ccd478c81ff 100644 > --- a/fs/gfs2/aops.c > +++ b/fs/gfs2/aops.c > @@ -600,7 +600,7 @@ static void gfs2_readahead(struct readahead_control *rac) > struct gfs2_inode *ip = GFS2_I(inode); > struct gfs2_holder gh; > > - gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &gh); > + gfs2_holder_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_TRY, &gh); > if (gfs2_glock_nq(&gh)) > goto out_uninit; > if (!gfs2_is_stuffed(ip)) Thanks, Andreas