From patchwork Tue Apr 4 13:58:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13200239 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 2A3D5C77B70 for ; Tue, 4 Apr 2023 13:59:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70313900004; Tue, 4 Apr 2023 09:59:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EEE7900003; Tue, 4 Apr 2023 09:59:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48F6C900004; Tue, 4 Apr 2023 09:59:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3AF28900003 for ; Tue, 4 Apr 2023 09:59:06 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 17C7440E1B for ; Tue, 4 Apr 2023 13:59:06 +0000 (UTC) X-FDA: 80643865092.13.72BDDB3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 8A80D8001D for ; Tue, 4 Apr 2023 13:59:04 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QKtJNp4e; dmarc=none; spf=none (imf30.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=1680616744; 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=Ppztqzi2Gw646l+hIyTnCePJrLfpu78r8b6P3LTQWro=; b=G3D73/zkgcLJLM2v5YEEWfzxCYjNfRJRDR/oXNTd96VHjS/nuIaZC8hAJQzFvCJcw5YakE 5VylWTmxYsZawdwpJrMdPWHQN7hNS7gMqKIrXBDNbB+V6oiAPFIeD5szs5WEPewsZ9kXLz ZyQYUzvC0EqtVzc/5+qVKRr6K34DdSM= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QKtJNp4e; dmarc=none; spf=none (imf30.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=1680616744; a=rsa-sha256; cv=none; b=KnwDwgAQmGIwGu32SiWwmot+VuKPngBwXoLmiSrf7gUz0Q+pBDW7UAkB3WRtIKpwuU7x1r RkofJDPJumFvxj8P/DiCeQZ0by6Q299sSJbeYsqOc8FKPat/VYd0U9yPZn9DODUvahUAj0 e/tgbBt8+saUGR6ttvvIKHysuqwm7iY= 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=Ppztqzi2Gw646l+hIyTnCePJrLfpu78r8b6P3LTQWro=; b=QKtJNp4eL+NLKoIYZbLEmbEGis 1qdDzcW0CcwQ29e84+KiR3pVsW6g6OntvQTB+mAqEuOKqIYap9JvAgvO0T+7PJXH8ugpx5+JVTnoD snk9NZgn+wdjGWSwu4NFqsi6+bG2AqhvrxkuVmBDbxFfffr3U8UH/tm1G1IxczdInG6JVD0QKhcPm HBnoWqq4DnsfJDZchMdMiEEzyfJhITGbfk5Swvh4slxDsFyb3QWrAmNeHUsFvML3JL0hD5h1iEltf O7wamIL02Wro9+OM/ml7U9mwh2uF+V3G6vdyXobRIWR8ABTZ3cMFiOJThLPe27oES5R20uxnt1s3v 5JtoEU9A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pjhBU-00FPcd-1A; Tue, 04 Apr 2023 13:58:52 +0000 From: "Matthew Wilcox (Oracle)" To: Suren Baghdasaryan Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Punit Agrawal Subject: [PATCH 0/6] Avoid the mmap lock for fault-around Date: Tue, 4 Apr 2023 14:58:44 +0100 Message-Id: <20230404135850.3673404-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: 8A80D8001D X-Stat-Signature: ewcjcwuk355waba48ummay3oety6qifo X-HE-Tag: 1680616744-981411 X-HE-Meta: U2FsdGVkX1/u0wp4jbSjVfXYQF2JanhI3AefHxc0yGWC8CYhiWZUimY5AQ2QoOBTa/64oZzzQ5TkUYyBQQxCS7jZIPHW/cY+ZU1t8HARg812deUcLvDvm2zpj6QYIBHiYocutdzFqI4xIeknW/PM6zTAXKnZMEl2mf0RthOhWsLupma5Fm02RPHCMX7wpU0LyqwCDlzFTBfi9Y85taXZrTwKkaOPKHmX3AyBh8l2YJFVJ49msdNWZh9k2l3SJWKn0bfkT9wzspohXHkdSyKMEfX6V5CT9cuMgqYcxOy7Chhbib+yGP4s/WCFY6I14q7lNXG58sXCSleNKPWtmWWX/tYYHxBSSLewI14NFFycms6WYoHVjDTKiYOoTPm4T0n/avZl6vz5BmIzjF27cki5nRj7/9YNXX0983qFd7URIJK2pQIG/pueKsBulGh8p3K/V1/vpS1tDQkYPmkOD54f+XQW3ozSctguhsIi9tG4v8X79SkTYhaT8UBjiwYhFPpNHXcsvTPakdOnubFADc5DsObZwoZRDPjAPwn8T0clNFEf9C0jsJ/RQQp7QDmdCfIznWM9ePZWVAJLV6Dz95GXmieugiRx5Sl+tRL7Ow79/qHrFqilPW2mhooFScdgfxZSirNajNdbMu+TpBTeG0+XChy80sKG+NotVSsIcyeOXowuFf/zsiygakOA2z4XS1G5rtQb76ZhIC31sakLles+Hy8+rRXh3HyvDQgr5ewDBlCv+soBNVHiI/COUM+xAvf32SrmUzi6WCuiUpmWnehhcR3Le7IANlso23zH0YRj6Q0shmMtFlGeHt6t1eG3Has3sMOXl/WKZOuseAY9Iy+8onW8i3+kZV5LiwYYT1qJzCwInjw26AKyyqd28PhMDe+13Rueigc8FFJbe+rqWQVnlAghN90IxiJrc2dmPpOAQnO4bAPrJgDsxiKkGC4jxiRBDkj7N/UuO2Zdn/5/VPV pfAnIM9V YTjeLRw0V8e+8svOvqiGA2ekEacLDam3plO7YrX+3HLkfPnSRM6lls6+XZd9+j3qHHtDl5teQyBr28tTc11k5HCTUascFhHH/LJVt2d87/00NbzsQA9Kgr4/Tv5iEMJ8yFEcv 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: The linux-next tree currently contains patches (mostly from Suren) which handle some page faults without the protection of the mmap lock. This patchset adds the ability to handle page faults on parts of files which are already in the page cache without taking the mmap lock. I've taken a very gradual approach to pushing the lock down. I'm not 100% confident in my ability to grasp all the finer aspects of VMA handling, so some reviewrs may well feel that I could have combined some of these patches. I did try to skip one of these steps and it had a bug, so I feel justified in proceeding cautiously. Several people have volunteered to run benchmarks on this, so I haven't. I have run it through xfstests and it doesn't appear to introduce any regressions. Matthew Wilcox (Oracle) (6): mm: Allow per-VMA locks on file-backed VMAs mm: Move FAULT_FLAG_VMA_LOCK check from handle_mm_fault() mm: Move FAULT_FLAG_VMA_LOCK check into handle_pte_fault() mm: Move FAULT_FLAG_VMA_LOCK check down in handle_pte_fault() mm: Move the FAULT_FLAG_VMA_LOCK check down from do_pte_missing() mm: Run the fault-around code under the VMA lock mm/hugetlb.c | 4 ++++ mm/memory.c | 28 +++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-)