Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2960387ybt; Mon, 22 Jun 2020 11:16:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHXsPTIDuh+sw6BxeOWTjdoO3rJQAmSCXqHjDTEvHxxpFIb1sAm+p5Spmq9GOVs1EScZeF X-Received: by 2002:aa7:d2d2:: with SMTP id k18mr10972499edr.16.1592849764022; Mon, 22 Jun 2020 11:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592849764; cv=none; d=google.com; s=arc-20160816; b=XZcUcN0KHno/6+UZq/hRGeoZgllYE5N2s7TkRo76kgzCPRTxJsUUS2tRYiU2J65COp CZhfhAwhgb1D2A+BQI/IgwUliWSMyf8HK27jy2z37SLWNJHlLDyTZFubOJzhmcZ/e8GE quS9pw3lfKL4j2fqqLZ+z3hDwhwdVhKs2lrpdmkFumnqO39Ox5ENaAaDCEUBLvUAFxYM euMgPKwDibBSgNveRTvMIL0mJ9poifqiZg9UD5w8p6xklTATsPW1d0Pl6tXzLUuNaxf5 i4w++H1o21WSROPj2rIP/3Wj+gpSHtnkvq5CVsgkBpnpXjHqGZGBji7aQVhLYHyjsGjY GNtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fI19LO2+kVeZbFNCAbzHEO3fT5rq3PpBrNGKrOZ0eJU=; b=pjDpes7UW1rGKTnNDf9keckjyZLLDPHaQqQwZkPgTvobEn+62Och2BjNegQ+j7Vx66 /vCNFa9gsYO/suKZKyC6DSFGU3WV4R+m/ideXosZoC9Yzq2SyuqWPRF7unPJn7jUMjVD ZCh+Fq8pwRfLh1ZcDZFcB0AeAnK20HMBLx0P2IwLOkoZdMJA0FGTi7+rJ7e4+kkk3TgX 4CmgyXph2iWjTCTS3JtLAhz/YK+AE+wivG+4JDLtqp6C16L+9vr1k/vQzzQe1+RSNlcp zdlsV8rVtGvS/SaiOJZCE2itEGE9oqlBDYIsEXa1zJNHyT57KeP90MEAbe8OJaSRd/SH UKqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=PvTVCLag; 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 c25si793362edv.335.2020.06.22.11.15.40; Mon, 22 Jun 2020 11:16:04 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=PvTVCLag; 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 S1730166AbgFVSN4 (ORCPT + 99 others); Mon, 22 Jun 2020 14:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730099AbgFVSNz (ORCPT ); Mon, 22 Jun 2020 14:13:55 -0400 Received: from casper.infradead.org (unknown [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FDCBC061573; Mon, 22 Jun 2020 11:13:55 -0700 (PDT) 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=fI19LO2+kVeZbFNCAbzHEO3fT5rq3PpBrNGKrOZ0eJU=; b=PvTVCLag7uWuChnh7GXE/F0LfY Z/qG7GMHeiyvLMalJYaNPM5H2wV64nnXWJljQVKbr9MJd1/CfpoXXs1pzSqcd2koLO0AAu4lc38jV 2vb4u2ltkwZCnZV0mo/zpJIXHkOiH9lv8VJqmLUYXzmc9mqqnFBsMl3hKjlbMoBu05CgjLICfXV+n XtKHRShvzjEvXDeII2yVQZFu7b+bME8CV22ThUZ41gnaU8SS0V021NrtK06IvWm0A3I8y5tDHJecr 36TCrnJk4k1fhtbYGWX3HZ74cAgYu5cfIYBrmXJzKH9V+ciyL6+kO1mXQ5AFT0VJggUlyg6z4SaGs QNmQdp6Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnQws-0005kx-1f; Mon, 22 Jun 2020 18:13:38 +0000 Date: Mon, 22 Jun 2020 19:13:38 +0100 From: Matthew Wilcox To: Andreas Gruenbacher Cc: Dave Chinner , linux-fsdevel , Linux-MM , LKML Subject: Re: [RFC] Bypass filesystems for reading cached pages Message-ID: <20200622181338.GA21350@casper.infradead.org> References: <20200619155036.GZ8681@bombadil.infradead.org> <20200622003215.GC2040@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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? 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))