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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,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 4ED73C433DF for ; Fri, 3 Jul 2020 11:44:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0CE6E208B8 for ; Fri, 3 Jul 2020 11:44:42 +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="f8g/hiBb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CE6E208B8 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 834266B00C2; Fri, 3 Jul 2020 07:44:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E4EF6B00C5; Fri, 3 Jul 2020 07:44:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DD496B00C7; Fri, 3 Jul 2020 07:44:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 570DB6B00C2 for ; Fri, 3 Jul 2020 07:44:42 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 152C3180AD804 for ; Fri, 3 Jul 2020 11:44:42 +0000 (UTC) X-FDA: 76996582404.12.laugh42_0d07f2f26e91 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id DC2371801C9D5 for ; Fri, 3 Jul 2020 11:44:41 +0000 (UTC) X-HE-Tag: laugh42_0d07f2f26e91 X-Filterd-Recvd-Size: 2985 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 11:44:41 +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=mVR1gXljLGpsshXpPuPenSltifBQ0m7hA39smBDxocI=; b=f8g/hiBbZIFmGN0vjAXuJdzTqE jp7sz11bmMaGdybtODKGG6nwTVwV1b1+JJ7fAUxVO5cjRUrDVp6ORA5VJZ1yer2DYfGyl9k1pCbWZ KHWKerVFkXYI4wlHPU65bCOrMsGXmn+uQoCbc0ZYxG/v3XvwFYdX72ICY0HbR6x9SOPChTmOvms95 oZNxlRXL9Qe2ayvAqn0kvZOGhZegnZnQmlJULuDeWSdh6Owg/UuEbZDFnnp3vlGgwal3K2KXnpcTX MVDYdyPnBizWtAluNduvxZHxkeCJ2r7o/vTii2Q0Ochsg9O95PsPgOCBrh/O1HbEs3C9e/PNnTeCt B6OI3LKw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrK7R-0000OA-TV; Fri, 03 Jul 2020 11:44:38 +0000 Date: Fri, 3 Jul 2020 12:44:37 +0100 From: Matthew Wilcox To: Andreas Gruenbacher Cc: Linus Torvalds , Dave Chinner , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v2 2/2] gfs2: Rework read and page fault locking Message-ID: <20200703114437.GF25523@casper.infradead.org> References: <20200703095325.1491832-1-agruenba@redhat.com> <20200703095325.1491832-3-agruenba@redhat.com> <20200703113801.GD25523@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200703113801.GD25523@casper.infradead.org> X-Rspamd-Queue-Id: DC2371801C9D5 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 Fri, Jul 03, 2020 at 12:38:01PM +0100, Matthew Wilcox wrote: > > @@ -598,16 +562,9 @@ static void gfs2_readahead(struct readahead_control *rac) > > { > > struct inode *inode = rac->mapping->host; > > struct gfs2_inode *ip = GFS2_I(inode); > > - struct gfs2_holder gh; > > > > - gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &gh); > > - if (gfs2_glock_nq(&gh)) > > - goto out_uninit; > > if (!gfs2_is_stuffed(ip)) > > mpage_readahead(rac, gfs2_block_map); > > I think you probably want to make this: > > if (i_blocksize(page->mapping->host) == PAGE_SIZE && > !page_has_buffers(page)) > error = iomap_readahead(rac, &gfs2_iomap_ops); > else if (!gfs2_is_stuffed(ip)) > error = mpage_readahead(rac, gfs2_block_map); > > ... but I understand not wanting to make that change at this point > in the release cycle. That was stupid. I meant to write out: if (i_blocksize(rac->mapping->host) == PAGE_SIZE) error = iomap_readahead(rac, &gfs2_iomap_ops); else if (!gfs2_is_stuffed(ip)) error = mpage_readahead(rac, gfs2_block_map); Since the pages are freshly allocated, they can't have buffers, and the mapping comes out of the readahead_control, not from the page.