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 C0AE7C00A5A for ; Wed, 18 Jan 2023 02:46:02 +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=yYSL41qtFUv6gNya9AYuoJCFdDq1XRNpdfS+9nDGokE=; b=O3UAnkpSvXUd4T q2UDWVfbvw1/L0KxLi5Gz3hKLtjZp1paykm8GhAcX+C+J0/Mg0MRhZT+67TDuC1wYsInV9UOtANfM pPp/DG4N0gl4v2ZmjTEOrIZ6AL+X9WoNzSjUDwhroeyC37Px2oBTZyh46vNFpbLFPLd9JrkS50gje 15tvAP4siN80xbRw/oyQlYzmtHBbDUinjJ6aW33+4G6mBUmGi4CrKGr47jdg6AsWDK6T9/clknTVn R2BmfpsYBcQDIu0f+tUBjxJIPZx7ruEQpXqnD05IDI+BIsKWY9K+pDRMDuwzR7nvJX2/zcz3OSris M6G1DZUa68B8TOOlXi9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHyRa-00GccN-Kn; Wed, 18 Jan 2023 02:44:54 +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 1pHyRY-00GccB-R3 for linux-arm-kernel@bombadil.infradead.org; Wed, 18 Jan 2023 02:44:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MGpdnLSCsy4iJTcYeMqTf0hkShjXgJaZl556rybxYcc=; b=LgtkpNzsFyaJdmFoM4zFTvjFAt Ao0YdH63TZt9RuzJ6Jp2atj9NKcViphPYwdS+B9R56VTZ6LdgTBITlFfMh6TzB/XcRGNXjsOOtgu6 aIPuxzOdZSS0yVjg747/T0PwNU+0/508fiqbDMy2yO/t7mf0IfznrHag7q8RjS5XJVA4VMfqYuwl0 ulHk6RyXVZHBP8284w9PmU5Ys9jP5MaL1tYqADfmpXKvKQXHiR+iAXVdGRcYnzrfwH8PupJzp9apk +hGZy6biK6xGQhULog6BkfaGpEdf2xnt5Y/7Oy5OU1xCO7Ns1R6g+Y5KfUc2AdfpOCbogT6bTwOeC bnYjNyHg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHyRY-00AHX7-0B; Wed, 18 Jan 2023 02:44:52 +0000 Date: Wed, 18 Jan 2023 02:44:51 +0000 From: Matthew Wilcox To: Suren Baghdasaryan Cc: Michal Hocko , akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, 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 Subject: Re: [PATCH 28/41] mm: introduce lock_vma_under_rcu to be used from arch-specific code Message-ID: References: <20230109205336.3665937-1-surenb@google.com> <20230109205336.3665937-29-surenb@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 Tue, Jan 17, 2023 at 05:06:57PM -0800, Suren Baghdasaryan wrote: > On Tue, Jan 17, 2023 at 7:47 AM Michal Hocko wrote: > > > > On Mon 09-01-23 12:53:23, Suren Baghdasaryan wrote: > > > Introduce lock_vma_under_rcu function to lookup and lock a VMA during > > > page fault handling. When VMA is not found, can't be locked or changes > > > after being locked, the function returns NULL. The lookup is performed > > > under RCU protection to prevent the found VMA from being destroyed before > > > the VMA lock is acquired. VMA lock statistics are updated according to > > > the results. > > > For now only anonymous VMAs can be searched this way. In other cases the > > > function returns NULL. > > > > Could you describe why only anonymous vmas are handled at this stage and > > what (roughly) has to be done to support other vmas? lock_vma_under_rcu > > doesn't seem to have any anonymous vma specific requirements AFAICS. > > TBH I haven't spent too much time looking into file-backed page faults > yet but a couple of tasks I can think of are: > - Ensure that all vma->vm_ops->fault() handlers do not rely on > mmap_lock being read-locked; I think this way lies madness. There are just too many device drivers that implement ->fault. My plan is to call the ->map_pages() method under RCU without even read-locking the VMA. If that doesn't satisfy the fault, then drop all the way back to taking the mmap_sem for read before calling into ->fault. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel