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=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 F0B0FC433E0 for ; Mon, 22 Jun 2020 18:13:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B4D8120738 for ; Mon, 22 Jun 2020 18:13:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PvTVCLag" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4D8120738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 44A336B0002; Mon, 22 Jun 2020 14:13:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4206F6B0006; Mon, 22 Jun 2020 14:13:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30F0C6B0007; Mon, 22 Jun 2020 14:13:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id 181B06B0002 for ; Mon, 22 Jun 2020 14:13:52 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C7787181AC9B6 for ; Mon, 22 Jun 2020 18:13:51 +0000 (UTC) X-FDA: 76957646262.13.beast13_3a166d426e34 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 0399718140B80 for ; Mon, 22 Jun 2020 18:13:47 +0000 (UTC) X-HE-Tag: beast13_3a166d426e34 X-Filterd-Recvd-Size: 2872 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Mon, 22 Jun 2020 18:13:47 +0000 (UTC) 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: X-Rspamd-Queue-Id: 0399718140B80 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 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))