Message ID | 20230127194110.533103-27-surenb@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA8A6C38142 for <linux-mm@archiver.kernel.org>; Fri, 27 Jan 2023 19:42:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6345C6B0078; Fri, 27 Jan 2023 14:42:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 598026B00A3; Fri, 27 Jan 2023 14:42:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 410F26B00A4; Fri, 27 Jan 2023 14:42:25 -0500 (EST) 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 2EBE36B0078 for <linux-mm@kvack.org>; Fri, 27 Jan 2023 14:42:25 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id ECF29A03F6 for <linux-mm@kvack.org>; Fri, 27 Jan 2023 19:42:24 +0000 (UTC) X-FDA: 80401600608.14.4E4ED4C Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf23.hostedemail.com (Postfix) with ESMTP id ADF5A140020 for <linux-mm@kvack.org>; Fri, 27 Jan 2023 19:42:21 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="KWtfJ/7x"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of 3GCnUYwYKCN8TVSFOCHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3GCnUYwYKCN8TVSFOCHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674848541; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sBLmwmiYmTj+OGGVUcLxhx0PU/jBUoUEJpANG8soAfU=; b=i0NoHPm0+EiqB86XK9A2n436t2A2AVKfc0+Poud9EW9fC/l9yeUKKPu3hG0McZ11K2PQ1L GJXJmE2iulK05YHOETFqLV02e/BSupunZKRaTAhg2wfaBiYFmpYMv6fZ1o5g9Ijn51GXiJ p6GLFV7sUfKS6XbsszOKebBxamfn6S4= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="KWtfJ/7x"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of 3GCnUYwYKCN8TVSFOCHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3GCnUYwYKCN8TVSFOCHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674848541; a=rsa-sha256; cv=none; b=pFZ3nR3t2CK3MEbkriy5QhKXZWbZSuaTxz1f/TZeYFXglAbibMY6DliBGfyYbsUNsu7Fh1 q8kJeIl1IRwAMSwW83JdZoKp0f3gdVibl0jHqGnacvLhDmlfgA1oDd9legoWy4Vwtd7sXQ XLYYt6RspZV1XujiGHFbjInWwAgQkdU= Received: by mail-yb1-f202.google.com with SMTP id n194-20020a2540cb000000b008038647d9ebso6356617yba.5 for <linux-mm@kvack.org>; Fri, 27 Jan 2023 11:42:21 -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=sBLmwmiYmTj+OGGVUcLxhx0PU/jBUoUEJpANG8soAfU=; b=KWtfJ/7xIlPNyMbJgMly5Sn2+77Pi3kT3bIKcXhSEYdAbccLPUNTncstNEX89dvAhW NM9ImIflxrHOdJ1Mj5fWozRK69MXYGw+crQDfh9Oftap/iRU1kAVPiBZhr/+UuvLj4+U 4LLcR3mdcWgS75oxY+Q2vGwsrXQ6jEpwNWpRZ0m4MKHrCT8iGAtEZyFhrSxdE7CjPr88 djL5aWWS3cMBdV/JlcmaRg0LM4Y33l8LwLfoSQoWCllE6I7RGCcpBFSNwKknGwVlLQii i5R/yajGZAULuwac7zP2AeGWc0Ux4Tm1rMqU81PAQU3nWhlQVK4py4JD6fzjGBwa6RFE gFWQ== 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=sBLmwmiYmTj+OGGVUcLxhx0PU/jBUoUEJpANG8soAfU=; b=Efg6UtUKWs/4WJLqDbFb8UEXh7KJ0ihB5c77doGmS+KR0RCPM56IRSqdK6x6eq0Xoa 2DNFWnYx85CfROCy25gC5kuV7PSi8pyAmvKZIuG3ySnXkVwniHZzhuwABM4VZelmvfem fdO8xKJ2xjmay3f8atn3W2emUcY4quZsTVek1g01A5uzYzncEviOfSDbhz3Co+Fuwl/5 Uz1Vq4vg0Ra+k+jhJj+IIexdGRYneIxvx8H1NMLGbEpfPj5zMqKy0/bsrzj18DvZtx0E R15HMFBN8mdWa6nM5ozpYvccY5aidwvForD1RLRKf53o9v5lhEOh48FqIGcTYVMvfAPk ZN6Q== X-Gm-Message-State: AFqh2kr11PTQB7+nVz21uQecmLSUYViZhpCPTyoH/xqwKQS50qHG7XuW JOrU83S2mQN/ZdXs5lrVdOqsX2mcBL0= X-Google-Smtp-Source: AMrXdXtj44VmRN6kQLB49pXglCfjpmg9iXCqYgU9gl6+Dl4v+hAma4/0PMDtIg4t8IMM3q4b9OalQWjETEg= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:4e19:be9:c5d0:8483]) (user=surenb job=sendgmr) by 2002:a81:cd7:0:b0:4dd:9ed1:fba0 with SMTP id 206-20020a810cd7000000b004dd9ed1fba0mr5011323ywm.265.1674848536283; Fri, 27 Jan 2023 11:42:16 -0800 (PST) Date: Fri, 27 Jan 2023 11:41:03 -0800 In-Reply-To: <20230127194110.533103-1-surenb@google.com> Mime-Version: 1.0 References: <20230127194110.533103-1-surenb@google.com> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog Message-ID: <20230127194110.533103-27-surenb@google.com> Subject: [PATCH v2 26/33] 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, paulmck@kernel.org, mingo@redhat.com, will@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, rppt@kernel.org, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@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, Laurent Dufour <laurent.dufour@fr.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: ADF5A140020 X-Stat-Signature: ri1ko7f7t7bqwqx4zd8u737hdacn3z9r X-HE-Tag: 1674848541-437479 X-HE-Meta: U2FsdGVkX1/+2jmO9FS69/hZTCfZwnlSuDOFsx47uvAJMoozAtHahe39ZatEEPYMsi97v29p/Xg8FMtiHgSwFnblRopdgsmRC+U2LTJgA4gOsWpzrtEYyJP0lIb6ojIWtv0yx0WpMI4h0F/xs74ydxdj5qJa52e1V69ZzDfJQBn+fISdaU3QgBwPaGcKk6SzvqpVh/lhtYtY1ZNMkpdXK+K6Pfqi4HB/fuZUON3MhLqPwlyVHL73cr2nSMcB7120J77bnW5nz/5V4jssnOnO7WutlldJAsgNOZC1m8HdqPy84G0DsXygVjDTt6vXgAkQDJ8TtMyKjxzXuxfw6YJTpJ4k7N8BoAfytF9FYpVzXc2IEa73pGuv/ZDxg9zLXz8iP5ScOTqFyTXGVFP/mJ92VLTKp/kuWPgLtelW7P05lHHFaKceuUfpAx8zJxhyRdYUygvuo1zzgsICbzDY8XI/cS+RaAD2uB8Bfwni1RLAQGeGCrpMZ/F77p1bz1snF9YVaKBpCm8DUR4VrbLMViy2n/OBDZY1wd0w8Gpy78qYBZJwDkiW8jcmycIQSsFfWG7vpp1/vAVFrI0PgE2W1eAo7d2DxZqpQgmGSeWpC7KM+Lhko3AvmC6BG84BgMb6scK7c6SrSspa5ZoHD9mZS2ajluGH+VQTcW60jJFIs5zMy40VrNgP670Uap2dckuHzmnFbomPc9c7I84rN9F6mBwUr3wyWxTEn1D1TBHZ2PWOcJhX1XhjBL1tCT300LykyX5QOenzPFQSHp6H+BWL3GhODwlAgkqhv+SpBsVmx8P/wN5V7I07XloBVbKFi/RKwPzhDFK5UFIBVot8hERDAlCdfw+7x9dP1V1gWoG97l79d6NTPidZSg8vVmlQpMR7gx/Ev+SaTEexnPnHYv2lOasapcxNPviHCkLu0ys0MdHOVUZ/vFyrp48rbi7RfkZBpdmxREnNQ8rbkAQQsjO9p62 VrM/Up9W jg1J7DDR17PtqdVf/7IP3E2vLUMEZaPo3MGSmaWx/0vVHRP6p30X1iU/OQ7eCDDm5nMqnd3PpZngtO3bzBWUecVlMlHQOMJDni4aPr1FLZexJR1Xo3nXQ1ZyDQea0CK1TZPKYldLF+unvYY6UJ5EgGMf1mkrOTs4MtNbHSt5psophBbfkuLZE+mAuMCrIPjzALrxLlIx4HGTyfnVWvOJJUURTn+UVVyRuM4HKV84ASLrFNVz08f0KFigoY7poAtgm6tN6/z9MNill7OM9IYojNBxZZzQ45H8XBrkaxYaTjX51CQ7vpcYbUSc+slIM6dnnPLu2ZUBwmA1dHJQDTOcA0An3O48Vb5p5E8WogxiGmIBlCd56Br/Lxkqb163fvVNbpPW5pwNItJ3IZuGhkeg4ijonjlfLvQYYeXQSiG9MzWnKHNcp0D7DDvESc+0z2RHIm42nqtTPoxo5WLMHZ8wdwMJxy2CIcPBnW4PMefe6zTX0WX8yNLxqHyRBoc5L7Fdvce1vZkKVOY/s/iafRpKDIZVNfIfz3xYVbRQtM2i28w8KyLHwGxIwMfvvFMGI8pE5MD7IduFl4EJtJSk9SOKzIThKFPfW17u0P8aQyltDlQAeIJJRNyDMTKJYjL/zRiGqBmMPDJ9LJdx2bmt2kdRygrhZP4z0K9alcv5oLf6Y2Y/bIMymISoop0qXPICrcr+4rZO9 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: <linux-mm.kvack.org> |
Series |
Per-VMA locks
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index 593548f24007..33ecc850d3cb 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3690,6 +3690,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)) {