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.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 B7E9DC433DF for ; Wed, 17 Jun 2020 02:22:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 78D0420882 for ; Wed, 17 Jun 2020 02:22:18 +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="Pw7h6Zur" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78D0420882 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 E8C1D6B0002; Tue, 16 Jun 2020 22:22:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3C226B0003; Tue, 16 Jun 2020 22:22:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2A336B0005; Tue, 16 Jun 2020 22:22:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0123.hostedemail.com [216.40.44.123]) by kanga.kvack.org (Postfix) with ESMTP id B8B8F6B0002 for ; Tue, 16 Jun 2020 22:22:17 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 229BF356E for ; Wed, 17 Jun 2020 02:22:17 +0000 (UTC) X-FDA: 76937104314.05.waste33_1d07e2826e04 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 0339518014CB2 for ; Wed, 17 Jun 2020 02:22:16 +0000 (UTC) X-HE-Tag: waste33_1d07e2826e04 X-Filterd-Recvd-Size: 4626 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Wed, 17 Jun 2020 02:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=BEusnUbR+/cmrBB9bk/xdvHCANKyUH/aAcSZAMuW5OE=; b=Pw7h6Zurn3kEfvE1eYLcuqezpS 6dv6YNzk6+f6NL9T5b1t5Q3S1oT5qqAMDEOxHE+1wGzAU1/UvkbHdNz07Ga1WaCWGzhKUCRSeZ6QZ o0I5/jAy2zGLAu1G4S3MZdS3qCqGws/6WiA4NRqQjbA9SmyY+Nnm0QKGoSQJFNIHsS2xUI0I9Udce qOHpLfYIPOR526dlzyvkD4gq0Xo6OO+YQA5h+uvfTaDDzfQbzfntE6t8KKL/bdGZugpf9j96kxyXi uqj9bm92o25yQodA2+9jXT7MN6tTeGOpuEujbqml8NcV0guvi1GGbOd5RpsedFvm4bLu4W95FUUfR YKCs+4uQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlNi9-0002wT-UP; Wed, 17 Jun 2020 02:21:57 +0000 Date: Tue, 16 Jun 2020 19:21:57 -0700 From: Matthew Wilcox To: Andreas =?iso-8859-1?Q?Gr=FCnbacher?= Cc: Andreas Gruenbacher , Andrew Morton , linux-xfs , Junxiao Bi , William Kucharski , Joseph Qi , John Hubbard , LKML , linux-f2fs-devel@lists.sourceforge.net, cluster-devel , Linux-MM , ocfs2-devel@oss.oracle.com, linux-fsdevel , linux-ext4 , linux-erofs@lists.ozlabs.org, Christoph Hellwig , linux-btrfs@vger.kernel.org, Steven Whitehouse , Bob Peterson Subject: Re: [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead Message-ID: <20200617022157.GF8681@bombadil.infradead.org> References: <20200414150233.24495-1-willy@infradead.org> <20200414150233.24495-17-willy@infradead.org> <20200617003216.GC8681@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 0339518014CB2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable 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 Wed, Jun 17, 2020 at 02:57:14AM +0200, Andreas Gr=FCnbacher wrote: > Am Mi., 17. Juni 2020 um 02:33 Uhr schrieb Matthew Wilcox : > > > > On Wed, Jun 17, 2020 at 12:36:13AM +0200, Andreas Gruenbacher wrote: > > > Am Mi., 15. Apr. 2020 um 23:39 Uhr schrieb Matthew Wilcox : > > > > From: "Matthew Wilcox (Oracle)" > > > > > > > > Implement the new readahead aop and convert all callers (block_de= v, > > > > exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qn= x6, > > > > reiserfs & udf). The callers are all trivial except for GFS2 & O= CFS2. > > > > > > This patch leads to an ABBA deadlock in xfstest generic/095 on gfs2= . > > > > > > Our lock hierarchy is such that the inode cluster lock ("inode gloc= k") > > > for an inode needs to be taken before any page locks in that inode'= s > > > address space. > > > > How does that work for ... > > > > writepage: yes, unlocks (see below) > > readpage: yes, unlocks > > invalidatepage: yes > > releasepage: yes > > freepage: yes > > isolate_page: yes > > migratepage: yes (both) > > putback_page: yes > > launder_page: yes > > is_partially_uptodate: yes > > error_remove_page: yes > > > > Is there a reason that you don't take the glock in the higher level > > ops which are called before readhead gets called? I'm looking at XFS= , > > and it takes the xfs_ilock SHARED in xfs_file_buffered_aio_read() > > (called from xfs_file_read_iter). >=20 > Right, the approach from the following thread might fix this: >=20 > https://lore.kernel.org/linux-fsdevel/20191122235324.17245-1-agruenba@r= edhat.com/T/#t In general, I think this is a sound approach. Specifically, I think FAULT_FLAG_CACHED can go away. map_pages() will bring in the pages which are in the page cache, so when we get to gfs2_fault(), we know there's a reason to acquire the glock.