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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57604C433EF for ; Tue, 7 Dec 2021 22:48:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA7326B0071; Tue, 7 Dec 2021 17:48:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A55F56B0072; Tue, 7 Dec 2021 17:48:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F66A6B0073; Tue, 7 Dec 2021 17:48:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id 7DC7F6B0071 for ; Tue, 7 Dec 2021 17:48:01 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3E7241813121C for ; Tue, 7 Dec 2021 22:47:51 +0000 (UTC) X-FDA: 78892487142.08.A0DB710 Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by imf20.hostedemail.com (Postfix) with ESMTP id D4B71D0000A2 for ; Tue, 7 Dec 2021 22:47:50 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id v203so1496549ybe.6 for ; Tue, 07 Dec 2021 14:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4NAkzEae8rEjb3+qLzjOqDzzWbipCWVNMZSADlSEB3Q=; b=S04noigKvm8Bjv2Uuade/bYbL4T/MVHndJwYOjZ3diQDchiFeIXkh/Iv2Z1VZlOuvZ RWj5PYIBWCKL6LHqeqTdlvxYS22x+umwjKY9t4bJOB/W0wItoZFsFyzmfr18B0e8A/IN WdPsNY1kVGF9BdFgrqEFLFehj2kpwpv4O/iCTeCppXEzMaq8J0gSyKP+WYGoa55yp5xC D0tsGee/O+QhIqKBcc+odXWzIkI27p/d4q662FazlTrTvDyISuaEWdGHpjDQQCzjxE2a D3u+qDxoHRpTw/44WHLSpKXzFYIXcsC0AQ7cCZoSS2XvbDXbYRExGIjDpRNzDrhnloip ixWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4NAkzEae8rEjb3+qLzjOqDzzWbipCWVNMZSADlSEB3Q=; b=jCKJaolBPfBc/QBfpwAleKpvpBnO3Nvj0ql6+EXpET+D/VDVFKUrxpdyLt8tO9T+oS 6wxptsX+Ow+vmlCsrpD1LlnrzXYRoUu5HbZeR4I69FYZGGSspKCQ2BgQ7WNNran+C90f 5KpYSxjftpM/fqUeYaaAUan6g7rwW0Z9e3MdFEyONVDPfyiqK87QFQVq3EWF25ptpoXK UDH62IadfupuLJ1VbrWVwsey59Yrj4g6vmHatZOKlkpH9VHvQZsxrm4CjdgxPdUr6ESu 2tyijsUhBAvBO+DMPoSOmBfyxXVEGeFCYSZTHW2yYy37lEsVV2ndTkZYj3T6vJEUNKOt +oVQ== X-Gm-Message-State: AOAM5320ggd24rxpbe312Pz0iWcJqsqZaxljAJCZmfCh/DBrdk3IUOHY 0mAg5ZAF4LOLB6ynfoCkcOkIhHHa07gy8iL5gtFhtg== X-Google-Smtp-Source: ABdhPJwHXgvCbDWxObMUDnD4Qr1CbTS9DPYT7YO9TngI6OrrX3PAZgBH08VONCFBFB/9/m7DVGqVCEGiJV9S2IF2MEw= X-Received: by 2002:a25:60d5:: with SMTP id u204mr58688606ybb.243.1638917269910; Tue, 07 Dec 2021 14:47:49 -0800 (PST) MIME-Version: 1.0 References: <20211207215031.2251719-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Tue, 7 Dec 2021 14:47:38 -0800 Message-ID: Subject: Re: [PATCH v3 1/2] mm: protect free_pgtables with mmap_lock write lock in exit_mmap To: Matthew Wilcox Cc: akpm@linux-foundation.org, mhocko@kernel.org, mhocko@suse.com, rientjes@google.com, hannes@cmpxchg.org, guro@fb.com, riel@surriel.com, minchan@kernel.org, kirill@shutemov.name, aarcange@redhat.com, christian@brauner.io, hch@infradead.org, oleg@redhat.com, david@redhat.com, jannh@google.com, shakeelb@google.com, luto@kernel.org, christian.brauner@ubuntu.com, fweimer@redhat.com, jengelh@inai.de, timmurray@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D4B71D0000A2 X-Stat-Signature: offtof356ymp8mtf7p91cdrz91zdq9io Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=S04noigK; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of surenb@google.com designates 209.85.219.178 as permitted sender) smtp.mailfrom=surenb@google.com X-HE-Tag: 1638917270-295709 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: On Tue, Dec 7, 2021 at 2:07 PM Matthew Wilcox wrote: > > On Tue, Dec 07, 2021 at 01:50:30PM -0800, Suren Baghdasaryan wrote: > > - Added a comment for vm_operations_struct::close, documenting restriction for > > taking mmap_lock in the callback, per Michal Hocko and Matthew Wilcox > > This should be a separate patch because it stands alone, but ... I thought about it and since it was relevant to the change in remove_vma locking, I thought it would fit here. However, if you insist on splitting it, I'll post it as a separate patch. Please let me know. > > > struct vm_operations_struct { > > void (*open)(struct vm_area_struct * area); > > + /* > > + * Called with mmap_lock lock held for write from __split_vma and > > + * remove_vma, therefore should never take that lock. > > + */ > > Your whitespace indentation is weird. And it'd be nice to make this a > kernel-doc comment (I know none of the others are, but that should be > fixed too). And naming the functions that call it is wrong too. > > /** > * @close: Called when the VMA is being removed from the MM. > * Context: Caller holds mmap_lock. > */ Ack. Will change and include in the next respin once I hear from you on the preference for a separate patch. Thanks!