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 F3AA7C433F5 for ; Mon, 6 Dec 2021 18:53:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D0B96B007B; Mon, 6 Dec 2021 13:53:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 380B46B007D; Mon, 6 Dec 2021 13:53:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2490A6B007E; Mon, 6 Dec 2021 13:53:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 11E456B007B for ; Mon, 6 Dec 2021 13:53:00 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B09DD86988 for ; Mon, 6 Dec 2021 18:52:49 +0000 (UTC) X-FDA: 78888266058.13.4921824 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf05.hostedemail.com (Postfix) with ESMTP id 8EDAA100004 for ; Mon, 6 Dec 2021 18:52:48 +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=v9emWhdzp63CN2LN1Xu2H8SaVorImjqcQXxFTzuy8e8=; b=X8cghBR2+xx7JpmVZlkV8diiAn Wr84pAFAzFenaKjtyg8iJEUS+hvDNFCh/1aOYksMpwsZiwYn5kVnCfFQvijdGShQ9ElcIh+uDVjd2 Zq7HA7gtccteDFguLLUZA3PVtI+8gHEWomSN/GyE3RgBaODXsdXFM2MP3Pq2aBTyZh1nJTN/sNvD6 cNiRzRIKzabDrfLhOFMCpY82SgzSeVgk+wYCa67xQu+lbDjUWlAPtdrNhygPiuUEiwh8xD/JjFuRb N/WRQKxsy9kAUxjw512iqtftoZbE3UxeH8EvH6iJqZSRAlOyLcNacI7DjJb+0PViv8LmCpWiZDw6M Tj9m9kSQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1muJ6C-005mVu-57; Mon, 06 Dec 2021 18:52:28 +0000 Date: Mon, 6 Dec 2021 18:52:28 +0000 From: Matthew Wilcox To: Suren Baghdasaryan Cc: Michal Hocko , akpm@linux-foundation.org, 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 v2 1/2] mm: protect free_pgtables with mmap_lock write lock in exit_mmap Message-ID: References: <20211124235906.14437-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: afgkubksanfhdf3uf8aen5weopt3xtbs Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=X8cghBR2; spf=none (imf05.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-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 8EDAA100004 X-HE-Tag: 1638816768-684706 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Dec 06, 2021 at 10:35:03AM -0800, Suren Baghdasaryan wrote: > > Other than that looks OK to me. Maybe we want to add an explicit note > > that vm_ops::close cannot take mmap_sem in any form. The changelog > > should also mention that you have considered remove_vma and its previous > > no MM locking assumption. You can argue that fput is async and close > > callback shouldn't really need mmap_sem. > > Should I post another version of this patch with the patch description > clarifying these points and additional comments as you suggested? fyi, vm_ops->close() is already called with the mmap_sem held for write in __split_vma(). If that needs to be documented, it's a separate patch because it's absolutely not a consequence of this patch.