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=-6.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 5072EC433E2 for ; Thu, 17 Sep 2020 15:11:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D74B921D24 for ; Thu, 17 Sep 2020 15:11:27 +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="GPkxwUMd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D74B921D24 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 85311900005; Thu, 17 Sep 2020 11:11:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80247900002; Thu, 17 Sep 2020 11:11:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F054900005; Thu, 17 Sep 2020 11:11:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 50BE3900002 for ; Thu, 17 Sep 2020 11:11:04 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F0D971827C81B for ; Thu, 17 Sep 2020 15:11:03 +0000 (UTC) X-FDA: 77272891248.16.water68_060756027123 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id BB321100E4B1C for ; Thu, 17 Sep 2020 15:11:03 +0000 (UTC) X-HE-Tag: water68_060756027123 X-Filterd-Recvd-Size: 4390 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 15:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=lu11y1IB6qPsE9QG9F+oQMlPRPTZIY05Da6y3WAX60M=; b=GPkxwUMdgSb1OJ4/VmsY06Tw3d wGaBexmE5C59ZCk9mEQrvh9oEg9vXINOmQweMRoeaKlDN+2g7USOiJ7p9L6bGvMTgyOEzZOtR669A jIht28BCCCPOx7e6FE0aFJU+a0OyffBNocDLpE1149X17KE2LrFn/XIZhTexixrbCr/7fuXh5bEIC 5+5CsSw56eGm4LgIdvEOovoEjzYZrFmqYQ0NKJCGq7JspTlxSRfyl5i2MbjOV1DdvtIMrAzZjoYaL ynre9v/sxNEHLDS79EF6RrWV5KTmLFDCVpjgtJr0LUrFEcYXA87AZmSArmQz3cvHn2mHKHdPH2VNi a4wd79ow==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIvYi-0001PE-2q; Thu, 17 Sep 2020 15:10:52 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, ecryptfs@vger.kernel.org, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, Richard Weinberger Subject: [PATCH 00/13] Allow readpage to return a locked page Date: Thu, 17 Sep 2020 16:10:37 +0100 Message-Id: <20200917151050.5363-1-willy@infradead.org> X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 X-Rspamd-Queue-Id: BB321100E4B1C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: Linus recently made the page lock more fair. That means that the old pattern where we returned from ->readpage with the page unlocked and then attempted to re-lock it will send us to the back of the queue for this page's lock. Ideally all filesystems would return from ->readpage with the page Uptodate and Locked, but it's a bit painful to convert all the asynchronous readpage implementations to synchronous. These ones are already synchronous, so convert them while I work on iomap. A further benefit is that a synchronous readpage implementation allows us to return an error to someone who might actually care about it. There's no need to SetPageError, but I don't want to learn about how a dozen filesystems handle I/O errors (hint: they're all different), so I have not attempted to change that. Please review your filesystem carefully. I've tried to catch all the places where a filesystem calls its own internal readpage implementation without going through ->readpage, but I may have missed some. Matthew Wilcox (Oracle) (13): mm: Add AOP_UPDATED_PAGE return value 9p: Tell the VFS that readpage was synchronous afs: Tell the VFS that readpage was synchronous ceph: Tell the VFS that readpage was synchronous cifs: Tell the VFS that readpage was synchronous cramfs: Tell the VFS that readpage was synchronous ecryptfs: Tell the VFS that readpage was synchronous fuse: Tell the VFS that readpage was synchronous hostfs: Tell the VFS that readpage was synchronous jffs2: Tell the VFS that readpage was synchronous ubifs: Tell the VFS that readpage was synchronous udf: Tell the VFS that readpage was synchronous vboxsf: Tell the VFS that readpage was synchronous Documentation/filesystems/locking.rst | 7 ++++--- Documentation/filesystems/vfs.rst | 21 ++++++++++++++------- fs/9p/vfs_addr.c | 6 +++++- fs/afs/file.c | 3 ++- fs/ceph/addr.c | 9 +++++---- fs/cifs/file.c | 8 ++++++-- fs/cramfs/inode.c | 5 ++--- fs/ecryptfs/mmap.c | 11 ++++++----- fs/fuse/file.c | 2 ++ fs/hostfs/hostfs_kern.c | 2 ++ fs/jffs2/file.c | 6 ++++-- fs/ubifs/file.c | 16 ++++++++++------ fs/udf/file.c | 3 +-- fs/vboxsf/file.c | 2 ++ include/linux/fs.h | 5 +++++ mm/filemap.c | 12 ++++++++++-- 16 files changed, 80 insertions(+), 38 deletions(-) --=20 2.28.0