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 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 D5BD1ECAAA1 for ; Tue, 6 Sep 2022 19:41:14 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1HNZLl/MMfph1vQXHadJWYJNM39EOWxckiYbR2IBAzM=; b=Mesf5onghSbMbQ iM9QoOIqEwyVnNf09KLSzVselX9ut/r399Kc4bgc5VBbNvvrmlepLducEjRDXkRc2xxQ2+2a7n0Gr nZx+tlaJ+hmpq/EFE6SaR0NDKYPDhegrTL4U5+Iqzdur/sTLxXyrr3Tco6UzLIfNfgzNw8zEzHlX3 tQzFr8JM73Ax0QNZZmMxDmTBehwj7c4HSNoAiTy09M22qoGFq6sDNvqMU4bGHuANZ2RdqQXEx5xWj qXCnr13alr6o0ysGSwiYvUg4G/0Zbs8PG8L03fpO+tWABXGijKX4U5xIAJNGctoEw/nGPaY5gALGy Vi7Yh8O/PnksclG0Rnhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVeQX-00GmTT-EP; Tue, 06 Sep 2022 19:40:05 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVeQU-00GmPS-5k for linux-arm-kernel@lists.infradead.org; Tue, 06 Sep 2022 19:40:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662493196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ipDmQ48fSdnKUDgmzFqHXYya44lh/1wuhiABbNwvM7Y=; b=ck9ijTxR/Q73O0X3pJmd4vxIxuwEJpBkYFM5b0wEQxI7dnuE98GfACBeZdMDy5Grd/VEdJ K14QOSu4yJgx8iLBwMaOwyekUtQZfbuLbkiBfYobOJQP+DQIeZ1l3tGS6Ei/8kAWo0Ezjr VNL2x2JgHynC+fP4CMvNbz7SdMjw9jU= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-178-5QJlz-b9NJOKUDlUM1EhPQ-1; Tue, 06 Sep 2022 15:39:55 -0400 X-MC-Unique: 5QJlz-b9NJOKUDlUM1EhPQ-1 Received: by mail-qv1-f71.google.com with SMTP id c1-20020a0cfb01000000b00495ad218c74so8685688qvp.20 for ; Tue, 06 Sep 2022 12:39:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=ipDmQ48fSdnKUDgmzFqHXYya44lh/1wuhiABbNwvM7Y=; b=qjqUVKmXMYzZbzwK6Ba5MjN49rPcUu5u63rfewSs7a1Oy8rwyb/5hbOojH7NFpDs3M 7/Mg2v/hU6JsovvpJDsPa/+UFXiv71VZ75hyB1fpX5ulLBrpUUcVhJm75F+sjwBbPkki lM6wiwFWTVQdxbYRapPX8ocAeZVt5xt/X+zEPzl0RArvGQqY3ce/XwUqmSVz9b279k1b 7rsWvhHe57rG6+v1SpjJrfAP12GpN6TmNP9+r7k/WGYuvdgOHhAKAc4LtNkEMKczeDXA hJhPSxjYuzJbIThJNo7EwuByIYAD/vwaZBJZNGllXRZ4/a3F58+aUUXrsARFslq2SWhl 6QNA== X-Gm-Message-State: ACgBeo2MYxgFixFFJfLIG9llfplJIZzjKaed/MLSzgdwJH2/x913Wgck LAQ35JEMyAqPX4c4ToHJxN40gAvSdhjORQTkBd8XXllmPrIyFGXk3zKqDMfbExS4tkr6SAOemuo wc333Eje6KaK2FREgyZW9HchxfJidWFfeSWU= X-Received: by 2002:a05:620a:2591:b0:6c9:cc85:87e3 with SMTP id x17-20020a05620a259100b006c9cc8587e3mr165288qko.577.1662493195305; Tue, 06 Sep 2022 12:39:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ttYQWiRMBv+iRAUF0TI1KrYDEUj4oUMahpKt92mQKBQU68PcCAvUwsnwEAqRUP4s0fa6Zng== X-Received: by 2002:a05:620a:2591:b0:6c9:cc85:87e3 with SMTP id x17-20020a05620a259100b006c9cc8587e3mr165268qko.577.1662493195065; Tue, 06 Sep 2022 12:39:55 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-35-70-27-3-10.dsl.bell.ca. [70.27.3.10]) by smtp.gmail.com with ESMTPSA id bk22-20020a05620a1a1600b006b9c9b7db8bsm12167528qkb.82.2022.09.06.12.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 12:39:54 -0700 (PDT) Date: Tue, 6 Sep 2022 15:39:51 -0400 From: Peter Xu To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@suse.de, 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, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, kernel-team@android.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH RESEND 19/28] mm: disallow do_swap_page to handle page faults under VMA lock Message-ID: References: <20220901173516.702122-1-surenb@google.com> <20220901173516.702122-20-surenb@google.com> MIME-Version: 1.0 In-Reply-To: <20220901173516.702122-20-surenb@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_124002_368357_8ECF5ABF X-CRM114-Status: GOOD ( 17.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 01, 2022 at 10:35:07AM -0700, Suren Baghdasaryan wrote: > Due to the possibility of do_swap_page dropping mmap_lock, abort fault > handling under VMA lock and retry holding mmap_lock. This can be handled > more gracefully in the future. > > Signed-off-by: Suren Baghdasaryan > --- > mm/memory.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/mm/memory.c b/mm/memory.c > index 9ac9944e8c62..29d2f49f922a 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3738,6 +3738,11 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) > vm_fault_t ret = 0; > void *shadow = NULL; > > + if (vmf->flags & FAULT_FLAG_VMA_LOCK) { > + ret = VM_FAULT_RETRY; > + goto out; > + } > + May want to fail early similarly for handle_userfault() too for similar reason. Thanks, -- Peter Xu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel