From patchwork Mon Mar 27 17:45:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13189761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6890C77B6D for ; Mon, 27 Mar 2023 17:45:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FEA5900006; Mon, 27 Mar 2023 13:45:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60F15900002; Mon, 27 Mar 2023 13:45:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B02C900006; Mon, 27 Mar 2023 13:45:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3853E900002 for ; Mon, 27 Mar 2023 13:45:37 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E9438ABA0C for ; Mon, 27 Mar 2023 17:45:36 +0000 (UTC) X-FDA: 80615405472.01.9F6869E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP id 17EF7A0021 for ; Mon, 27 Mar 2023 17:45:34 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pL1HS0Vi; dmarc=none; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679939135; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=aQoxK5bb3Ohj4wJwxB+pr91NWfdUFrQCSHmRCFwcTDI=; b=uy9I+zg5pRGetkBxtasODjmzyMaq5QlQKN8Bia0Rll8Y2qzl+WW298PfN1qLbRcTJLEKFN iS7FZ6lOYG/yXoBeBhqFlMvNV0muEXcfXZi62+SgfPFr5nQmwqjTjsqwIItj7sh57M2MRv MOPzEI/diP8kvvE8uqQy2lOAw5TpDH8= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=pL1HS0Vi; dmarc=none; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679939135; a=rsa-sha256; cv=none; b=GZrLMconhaw+Ic4gJbVOuydwiHZ23h8tB9KmGp3Uf103Z2A9yBX2Xrr7UKs9el15l2MFXG wx6vS+ogUEn/TncKDhhwkLyCwBY+FW6HXirI7K3fNSzQvu/rTQwMflD8uQQ5ikHun34ITm bgtqnwcZ/S8kOBW1lT7EJSnZgEfAdCI= 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=aQoxK5bb3Ohj4wJwxB+pr91NWfdUFrQCSHmRCFwcTDI=; b=pL1HS0Vi5KNmMOvGFuFYKGyM7r RsRG6kESDdHW3rUE914SVA3v4+ORiCdJhgEXpKzxb0r1OYeOb9YL04JZ5P75ET62PLuGsFK8ikaUs YkCjV5/EQJXciHGuL7KFMg/ObjTqn45UygqJCJ5p+X0r5zOCqwI5uwL0kkvZM0gB7P7+B3rze6n8G hrXufeB7Jmfac8IZYbZOWf02r4k4kJ5iXnR/fzuocp26M94/gyQJVF8NQqzWlZRsP7LazJrIXH8Y4 Mxn9B7y/NJSjReinYvyK+0zEtOaWQdqcdCNB6ZJfId/4ogXaniqasz0+V30rRHPOz8q895SBprFkM q/Hp9rEA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgquI-007bGS-7C; Mon, 27 Mar 2023 17:45:22 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-xfs@vger.kernel.org, linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 0/3] Prevent ->map_pages from sleeping Date: Mon, 27 Mar 2023 18:45:12 +0100 Message-Id: <20230327174515.1811532-1-willy@infradead.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 17EF7A0021 X-Stat-Signature: qw7o1zcrbmxiuwoyr4or53t7aac61wgh X-HE-Tag: 1679939134-144530 X-HE-Meta: U2FsdGVkX18c19dkt9VoHaZm4lgUVpg4/eyfjhC5nfuOkduBlsc9k6w7yDuxTh73LfaSkJYpKLWXrdxBFY+HvUhyJa0fiOGuPcFrvZoy4e6Mhh6AN0lSq/14R+EOGjCzYyYGA09zmrO2DyfxN+knffKsKrRGjTEtg99tc9gzMVkVdfzo6bUG6alUiKWMAxKQ+rU0PFE0EsjtOSvrR6TwjxhvOlAsW4HAzxvsbIHvMHj81zjhZSu41xO5dryW+CNh490s44f+PtOW4RRKm09WLTwfbSJ9MZq7a57BWFY8C5rlXCFwOnaEy14fVdWi6JAcRGOg3rOL7NdmZbNa13nJXG8jrYPOtengZ2hRXRprfed3yzUAMimRRXuaHBtktQgNKo+hOfMI+I/qu0GiMxn37tiCO54u4PGrs6x8jvAOUHjANu/m1HRfBEgyDTdo06ndHvgTM2EMjtK9xfxLcJSwGhoPMtULIPcNzwDNyV5e+7rGVOkxYW/UykfSwIR4Wiq23unw9wH2UUWIgmV7c/NRYPo8cO5CqXWRa/sfCSJr1tn+GNkfHWTawJ/Mwelr/IBWBPcmvqorW7BQWFa1KY6xUciR1pkQvdfMw7YUB7o8JYQUwOf4hf3mpU+KIUG4gzRNq+YpeF/FnD3eM3gqmI+MvNt/H7QMPqUXwlZcXUdliwiVnB5HIVYOBjmDMCKos/Pu2Kn0QTqh+q4XLDonIih8aF0X0lItxF9+OA6FCxIyvLS0XrCL3fdOU8bRLEPowig4+IA6bu131Blf7PGlck0YFLa9ZDe2bFgv7z/hPbIbKOA41SJrZAGP8wP69i7PyncTCuNLQ9v1fDBqgN5UNQQF5JZf0oTT0AaQkHqSm+J/R/uC6j0Pbard3zEtpHDK98ya2OMm7aPJRP8uCyQxD8XsFQJSlw0dwfyiOsq1wFnQPIBG26JWumAIX3N5Za6YaTpnFQRe5COu+k4iYgol4xz yNxxnDz6 w3I79YtTWTXt23RZieQT7N/cKo3lyCXdO+yAM+5/zmxBonz+6i8Fr8GIbar7kHDuOKrSa5KflGMGXvlgWW8FgDbUbjgl0x9WEzVuaqo/cYV6xVDpneon2ijt2Lv/Q+y/V+Z9XPuoI/DV+nbISdwAMQ2m4nagVll86bjM5467ycp3TdxszMSZCzyxEXHmnmJ4xunC/6TMM3+q2kJ4= 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: In preparation for a larger patch series which will handle (some, easy) page faults protected only by RCU, change the two filesystems which have sleeping locks to not take them and hold the RCU lock around calls to ->map_page to prevent other filesystems from adding sleeping locks. v2: - Add tags from David Howells - Go into more detail about the locking in the XFS patch Matthew Wilcox (Oracle) (3): xfs: Remove xfs_filemap_map_pages() wrapper afs: Split afs_pagecache_valid() out of afs_validate() mm: Hold the RCU read lock over calls to ->map_pages Documentation/filesystems/locking.rst | 4 ++-- fs/afs/file.c | 14 ++------------ fs/afs/inode.c | 27 +++++++++++++++++++-------- fs/afs/internal.h | 1 + fs/xfs/xfs_file.c | 17 +---------------- mm/memory.c | 11 ++++++++--- 6 files changed, 33 insertions(+), 41 deletions(-)