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 D1A07C433F5 for ; Tue, 7 Dec 2021 22:08:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 41E806B0071; Tue, 7 Dec 2021 17:07:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CC4C6B0072; Tue, 7 Dec 2021 17:07:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26CF06B0073; Tue, 7 Dec 2021 17:07:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id 140226B0071 for ; Tue, 7 Dec 2021 17:07:51 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C470D1857347F for ; Tue, 7 Dec 2021 22:07:40 +0000 (UTC) X-FDA: 78892385880.18.1A7C936 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 6C74630000A8 for ; Tue, 7 Dec 2021 22:07:40 +0000 (UTC) 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=p2HVXIrwF23DFq4/7NiWJ9lVGEQY74Pg2xDdCxWPG8Y=; b=LGgYXZ/qd/ovlj7hYPn79Gwyr+ Ji17rxXwSHQefPxCBGt6uKy08/w9OMnvtk3y2K87RFNxp2IA/thktCGNo8cbh1/7p9VErIYSKamj/ Mhp+zwAuitJ9RShXUeXiU+gWbHtD0LOnRVimcn61Ks5Lq5lSiWSsy4fKendTyWJA8c/w0j5gRwH8f eAx34R8MmJMjT+HfsU5JMvo9VParjfMRYSVc4ERuK5ci6gTv8Qdb31Pw1JIyjPRfVVaY+vk9Ha0gO eW/OH4lhuAq7Rb+kVDLA2oCiBVCqEhgn45d2dhMZPBAHcSSH0XmZYVbTtRZ1rnJFXif6WO6F2YY9d FrY89R7g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1muicG-007oqq-2O; Tue, 07 Dec 2021 22:07:16 +0000 Date: Tue, 7 Dec 2021 22:07:16 +0000 From: Matthew Wilcox To: Suren Baghdasaryan 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 Subject: Re: [PATCH v3 1/2] mm: protect free_pgtables with mmap_lock write lock in exit_mmap Message-ID: References: <20211207215031.2251719-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211207215031.2251719-1-surenb@google.com> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 6C74630000A8 X-Stat-Signature: gmxndcmg39s8buwmy6rfbyrbuy7wgmio Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="LGgYXZ/q"; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1638914860-585302 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 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 ... > 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. */