Message ID | 20230109205336.3665937-32-surenb@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A4220C5479D for <linux-arm-kernel@archiver.kernel.org>; Mon, 9 Jan 2023 21:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rjuUD6ICvDqyI1wxhqBWIw0uHpDf3LVoCWa9dBdclA4=; b=wazugCZRcHbxlCA6osgA8anh/e 3V9ACjpIYk8esWfuPUUdNNqth08xkpTrPKgFXazHkKKpwnMxeMKR5ROsQoPyTf0sw84bqXhfrwRws MFMN11SPhdHOUkI/leP5DKu163mE+NPoah4JZ78CYKJbKK0+zA0r5kLsgj88gJitdV6vdjUzWD05Z tpNVYUUZz0vUdjPlpbcfGChBS509JiuSk8/Ml3ACbrQgGqQu+oRCokC8XYNe4+TchgOfRhVrbHLo8 xwS2ilu0CW+fk6L/K7ImtHC7cJzMd+pMoTbAEqNynHwXXY/qvjUdGECna69VHEfvBRu0jgEK6czHI F8QPPwfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEzdv-004CSS-1j; Mon, 09 Jan 2023 21:25:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEzTw-0048n5-Hx for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Jan 2023 21:15:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wzUeswsih4PBYsAGoTi9IuotyhbGAzkWIDmV0FovK6Q=; b=tb2YcdNH2m2TR8m6/HxYcN6XvS vX2dGH8wUEPL1cTwGsSulidgPMmSOPctBXsuiUV0+R/WHJnM9IDYg9F7+Y/ApWI5uvAf+ZHj0mOZ7 o9mRRr6bCmLfieIZTZmAZQYozqFa/vQLKv/2Rv5LU4k7RhYBJCTR13ZrxKzaPi+4DfRdwhT0ltzum xcHXENQHfd5ir9xgyOYh5jK92euxizxDFsHB3JMbUwxvNwvnJ8k14ai/YW5XCyBbHzT+cv9xDBbql 1rThdTzYOLoSP4a6BjiRlFsFhpPCeiqgPv6N3nVXyFy9oCuex2Awcu1fjs44PB12z5JfLhNRZqcLz 3zrXGS7A==; Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEzAo-002ccT-3k for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2023 20:55:16 +0000 Received: by mail-pl1-x64a.google.com with SMTP id l15-20020a170903244f00b001927c3a0055so6951008pls.6 for <linux-arm-kernel@lists.infradead.org>; Mon, 09 Jan 2023 12:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=wzUeswsih4PBYsAGoTi9IuotyhbGAzkWIDmV0FovK6Q=; b=i8mCfCut8WK6+zjWPXPrBAn0OVK3TZZqUir2pgpkQNWhenu43X3/akUsts/8WrGL5U Ag1lqNnPrK3Lht8c6bYeEHv2p/KYkV84L0N5RKup3Lqh7FNgEiwz2qb9iAaK8aobnie5 SWRp3Ej3gvy6Gx0qa+UPT0Wm9SDIcbH9qbkEiBwV9a/y0P6JGxAF3x2bjosqkuWs4x2Q 7wdZhW31F8FFO8VMgBTx/6RIzfF9caT2DmPvdENgd9fKarg0jWwQoD/+83rrhQbpzEQp l4T3tmRoZNr6BoK1+IwDWlh9AP60sfKufgosjp9Mre5rIBM3jgdbCDpmS0FgJglfxzEq wvVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wzUeswsih4PBYsAGoTi9IuotyhbGAzkWIDmV0FovK6Q=; b=DwC40jmDt88KK0ABgdnReMPiNp3j/EenP9nRquO81/NHA2R5TD8Y2EZPpb8+z2sYyB pHJRi8wSgZH+NhlZrWoJ7SWSPD3Lb74Cr0D4FvmgLwMgKedXaqiBx4zc64fG0eQmhFqw nVkvR/cauS11HKIJ9632JNF21NKj+1/LnE4HmqcHYVuBZYrwCV4UOheA8P82SOoE4xlk mOWDGSwcC7RvgFVxoktdEST9OWaXqwM5muOMIQIHAamePJTNJHQ+rHWmokc42/OuyrBo FPaaVbDEXKa1B6vs0bHr9V3/miZ6t5rBovvhQZLFVeQ6QuwY5flDb+c/0cDELzeYXePf JAWQ== X-Gm-Message-State: AFqh2kq4r8fZugT1UgPT41BMeJCdPKkYR6xDf9x6Sf/ubo8qOY1gLwRA gvFwhOkShM8Mf9w9essfuCJTQdm6B5Y= X-Google-Smtp-Source: AMrXdXtXcDh9ACK+yDPMFgwqnCidD6d48HBoOS8XbTQx42HB6Mm5GZSyonzBvXPdXaN+wlg8/pxMUTj5geU= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:9393:6f7a:d410:55ca]) (user=surenb job=sendgmr) by 2002:a17:902:7d8a:b0:189:754b:9d9c with SMTP id a10-20020a1709027d8a00b00189754b9d9cmr4530740plm.120.1673297699405; Mon, 09 Jan 2023 12:54:59 -0800 (PST) Date: Mon, 9 Jan 2023 12:53:26 -0800 In-Reply-To: <20230109205336.3665937-1-surenb@google.com> Mime-Version: 1.0 References: <20230109205336.3665937-1-surenb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230109205336.3665937-32-surenb@google.com> Subject: [PATCH 31/41] mm: prevent do_swap_page from handling page faults under VMA lock From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, paulmck@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, hughlynch@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230109_205514_164214_B18EF204 X-CRM114-Status: UNSURE ( 7.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Per-VMA locks
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index 2560524ad7f4..20806bc8b4eb 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3707,6 +3707,11 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) if (!pte_unmap_same(vmf)) goto out; + if (vmf->flags & FAULT_FLAG_VMA_LOCK) { + ret = VM_FAULT_RETRY; + goto out; + } + entry = pte_to_swp_entry(vmf->orig_pte); if (unlikely(non_swap_entry(entry))) { if (is_migration_entry(entry)) {