From patchwork Fri Jan 14 22:06:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12714088 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 20FFCC4332F for ; Fri, 14 Jan 2022 22:06:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A648A6B00FD; Fri, 14 Jan 2022 17:06:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A14916B00FF; Fri, 14 Jan 2022 17:06:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DC616B0100; Fri, 14 Jan 2022 17:06:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id 7D4886B00FD for ; Fri, 14 Jan 2022 17:06:21 -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 476FC181D6051 for ; Fri, 14 Jan 2022 22:06:21 +0000 (UTC) X-FDA: 79030276962.18.B57A0C2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id EF4AB160004 for ; Fri, 14 Jan 2022 22:06:20 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4C3936200F; Fri, 14 Jan 2022 22:06:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5F25C36AE5; Fri, 14 Jan 2022 22:06:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642197979; bh=pux9fU/4421rHpB9PuKYNriuo1AkKdCq7YCEgbrVSUA=; h=Date:From:To:Subject:In-Reply-To:From; b=hxfP21H+1qKYdjfo5Uw+x4FsYc1ZXhxxMp2bYQLXU27mQwxUxHUOiGAFSYk2Aqjwb v22Ay++0MTvdyWpBNnep+QVfW2twom8VzrCEZxYjqYkIQ4wiKbrUVoAhyPaOG5lmcN pYUUhlgdMU11h8mSrE1FBikda4waFR32fH2n88VY= Date: Fri, 14 Jan 2022 14:06:18 -0800 From: Andrew Morton To: aarcange@redhat.com, akpm@linux-foundation.org, christian.brauner@ubuntu.com, christian@brauner.io, david@redhat.com, fweimer@redhat.com, guro@fb.com, hannes@cmpxchg.org, hch@infradead.org, jannh@google.com, jengelh@inai.de, jgg@nvidia.com, kirill@shutemov.name, linux-mm@kvack.org, luto@kernel.org, mhocko@suse.com, minchan@kernel.org, mm-commits@vger.kernel.org, oleg@redhat.com, riel@surriel.com, rientjes@google.com, shakeelb@google.com, surenb@google.com, timmurray@google.com, torvalds@linux-foundation.org, willy@infradead.org Subject: [patch 062/146] mm: document locking restrictions for vm_operations_struct::close Message-ID: <20220114220618.Hd0iXILBd%akpm@linux-foundation.org> In-Reply-To: <20220114140222.6b14f0061194d3200000c52d@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Queue-Id: EF4AB160004 X-Stat-Signature: ei313bxgeuru7qjrtb8j4gts7kmkch3b Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=hxfP21H+; dmarc=none; spf=pass (imf08.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam03 X-HE-Tag: 1642197980-443935 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: From: Suren Baghdasaryan Subject: mm: document locking restrictions for vm_operations_struct::close Add comments for vm_operations_struct::close documenting locking requirements for this callback and its callers. Link: https://lkml.kernel.org/r/20211209191325.3069345-2-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Christian Brauner Cc: Christian Brauner Cc: Christoph Hellwig Cc: David Hildenbrand Cc: David Rientjes Cc: Florian Weimer Cc: Jan Engelhardt Cc: Jann Horn Cc: Johannes Weiner Cc: Kirill A. Shutemov Cc: Matthew Wilcox Cc: Minchan Kim Cc: Oleg Nesterov Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Tim Murray Cc: Jason Gunthorpe Signed-off-by: Andrew Morton --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/include/linux/mm.h~mm-document-locking-restrictions-for-vm_operations_struct-close +++ a/include/linux/mm.h @@ -532,6 +532,10 @@ enum page_entry_size { */ struct vm_operations_struct { void (*open)(struct vm_area_struct * area); + /** + * @close: Called when the VMA is being removed from the MM. + * Context: User context. May sleep. Caller holds mmap_lock. + */ void (*close)(struct vm_area_struct * area); /* Called any time before splitting to check if it's allowed */ int (*may_split)(struct vm_area_struct *area, unsigned long addr);