From patchwork Fri Jun 19 09:39:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 11613617 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C44E138C for ; Fri, 19 Jun 2020 09:39:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C2E6B20786 for ; Fri, 19 Jun 2020 09:39:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BYBqmCyp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2E6B20786 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 BD2918D008F; Fri, 19 Jun 2020 05:39:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B82FF8D0089; Fri, 19 Jun 2020 05:39:52 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A97F98D008F; Fri, 19 Jun 2020 05:39:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id 905CA8D0089 for ; Fri, 19 Jun 2020 05:39:52 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2B752180AD801 for ; Fri, 19 Jun 2020 09:39:52 +0000 (UTC) X-FDA: 76945464624.13.limit43_4a01aa326e17 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 6DBE91806569F for ; Fri, 19 Jun 2020 09:39:43 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,agruenba@redhat.com,,RULES_HIT:30003:30054:30090,0,RBL:207.211.31.120:@redhat.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: limit43_4a01aa326e17 X-Filterd-Recvd-Size: 3908 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Fri, 19 Jun 2020 09:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592559582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=owa0qFAPsKpu74jXgvEbAGd5tDvX5jYwWR6WKxTC83E=; b=BYBqmCypAK4eUHnucG/nziWX025fR2b6WDx3Lpme1cJO2rH6xtWknJmLcq08adVZhzbMIR Zw5uSnW+3NDM5T++Hz0YoPyB8c8hM1uOFloWr2mjZS8PsJU3STVmTOU7rtC9lJFx8ra0QD S5ienyw20eHWewqo1Xf1qW9aj57Kk4E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-E2DQ6Q59N3WWMbSJVCOn4A-1; Fri, 19 Jun 2020 05:39:29 -0400 X-MC-Unique: E2DQ6Q59N3WWMbSJVCOn4A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE7B8107B265; Fri, 19 Jun 2020 09:39:26 +0000 (UTC) Received: from max.home.com (unknown [10.40.195.140]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E9A15D9E8; Fri, 19 Jun 2020 09:39:18 +0000 (UTC) From: Andreas Gruenbacher To: Matthew Wilcox , Linus Torvalds Cc: Andreas Gruenbacher , Andrew Morton , linux-xfs , Junxiao Bi , William Kucharski , Joseph Qi , John Hubbard , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-erofs@lists.ozlabs.org, Christoph Hellwig , linux-btrfs@vger.kernel.org Subject: [RFC PATCH 0/2] gfs2 readahead regression in v5.8-rc1 Date: Fri, 19 Jun 2020 11:39:14 +0200 Message-Id: <20200619093916.1081129-1-agruenba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Rspamd-Queue-Id: 6DBE91806569F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: Hello, can the two patches in this set still be considered for v5.8? Commit d4388340ae0b ("fs: convert mpage_readpages to mpage_readahead") which converts gfs2 and other filesystems to use the new ->readahead address space operation is leading to deadlocks between the inode glocks and page locks: ->readahead is called with the pages to readahead already locked. When gfs2_readahead then tries to lock the associated inode glock, another process already holding the inode glock may be trying to lock the same pages. We could work around this in gfs by using a LM_FLAG_TRY lock in ->readahead for now. The real reason for this deadlock is that gfs2 shouldn't be taking the inode glock in ->readahead in the first place though, so I'd prefer to fix this "properly" instead. Unfortunately, this depends on a new IOCB_CACHED flag for generic_file_read_iter. A previous version was posted in November: https://lore.kernel.org/linux-fsdevel/20191122235324.17245-1-agruenba@redhat.com/ Thanks, Andreas Andreas Gruenbacher (2): fs: Add IOCB_CACHED flag for generic_file_read_iter gfs2: Rework read and page fault locking fs/gfs2/aops.c | 27 ++------------------ fs/gfs2/file.c | 61 ++++++++++++++++++++++++++++++++++++++++++++-- include/linux/fs.h | 1 + mm/filemap.c | 16 ++++++++++-- 4 files changed, 76 insertions(+), 29 deletions(-) base-commit: af42d3466bdc8f39806b26f593604fdc54140bcb