From patchwork Wed Dec 8 21:22:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 12665269 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 8991CC4332F for ; Wed, 8 Dec 2021 21:22:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DFC56B0073; Wed, 8 Dec 2021 16:22:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2908A6B0075; Wed, 8 Dec 2021 16:22:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DA7F6B0073; Wed, 8 Dec 2021 16:22:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id EC2946B0073 for ; Wed, 8 Dec 2021 16:22:28 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A21638248076 for ; Wed, 8 Dec 2021 21:22:18 +0000 (UTC) X-FDA: 78895900356.21.87844AB Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf28.hostedemail.com (Postfix) with ESMTP id 538E390000A3 for ; Wed, 8 Dec 2021 21:22:18 +0000 (UTC) Received: by mail-yb1-f202.google.com with SMTP id l28-20020a25b31c000000b005c27dd4987bso6648365ybj.18 for ; Wed, 08 Dec 2021 13:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=d5tOeWVQTPZlPIcldFSGDsFeR/8SS3+rAWonTN5sOts=; b=As/cw9k3ZGJr9vmFWL0o7VOvTAGnXVlb8lU3/Obtf/MjW9RffGBvhTi9jUNHiB0iKY g1U1xeLjv30acYeHHel4z4Gj+bkE2iKp/JNXsJVAkeWgHX8YC5XjgE/iZgMXe/lWJaH/ yk1xCNdSL825zlvcc+aYZMRi2aZhzOvMlsGPrTkl5JPFkbuKX7uSOODzECIx5H86+ues 1+zUptQJzqGpwf2KXRjU+9i659AXUUR+fyajHgnELIPU66JLQG+GgOyRkMsEhozaq75O LbIChGRevW74+fRvT4mDBjW/vgoRFQH9mRsO8zKyTy8Ho7u0pZ6u08gXdpiHUjw5Jt/B Y3Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=d5tOeWVQTPZlPIcldFSGDsFeR/8SS3+rAWonTN5sOts=; b=cB1sQOSxBFAaKckWO+bF7/eE7bJ9pW1zLFdKUbFCqMgSasMMygN8bpnOvBo9uYwB4+ /DMFDY7MMcY0rTJQdLNUJJ0pUWpvXk/qMQE55kIGYxtyK1KK+ORkqk5brmgw0KKRb6KB PCfuHgBNnhLwelKmflnQkZidnAFs0cjCyd+aIrgXNm4UmkGIaG1OWoEym3MU8WpNlqca d2Llx/QuvMmv5YNhpZW5EYcf8yysCqhWSKPG+QNknBuyzowpNiYIRP/LrUVqXGiDjS4F wQO+NZFuNGvZ+tC2ro3xnqcoExZVwzSar10I2QxC26D5pPBi69nzz5wyxjS5EFK1Q/EL URUg== X-Gm-Message-State: AOAM533iDgfnaUQG65gYLq6aODiT2kSTAtpkgsb32wZDoIKsAeyzZdF6 HYri0xcdV+c2jZcyjwlfuVvL0XArtT8= X-Google-Smtp-Source: ABdhPJzCWyLFduG8i0U5m4IS2ULnaIHBO3AedQA8BjTiMJWDd56I5AJrHyXipL4ekCx1ST67qEUF19Klq34= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:4efa:9eac:2174:103c]) (user=surenb job=sendgmr) by 2002:a25:5c3:: with SMTP id 186mr1408710ybf.505.1638998537538; Wed, 08 Dec 2021 13:22:17 -0800 (PST) Date: Wed, 8 Dec 2021 13:22:10 -0800 In-Reply-To: <20211208212211.2860249-1-surenb@google.com> Message-Id: <20211208212211.2860249-2-surenb@google.com> Mime-Version: 1.0 References: <20211208212211.2860249-1-surenb@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH v4 2/3] mm: document locking restrictions for vm_operations_struct::close From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: mhocko@kernel.org, mhocko@suse.com, rientjes@google.com, willy@infradead.org, 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, surenb@google.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 538E390000A3 X-Stat-Signature: tswywbdfrbjtaoygt7s8hhbsw7x5wycs Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="As/cw9k3"; spf=pass (imf28.hostedemail.com: domain of 3CSKxYQYKCCYUWTGPDIQQING.EQONKPWZ-OOMXCEM.QTI@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3CSKxYQYKCCYUWTGPDIQQING.EQONKPWZ-OOMXCEM.QTI@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1638998538-846137 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: Add comments for vm_operations_struct::close documenting locking requirements for this callback and its callers. Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index a7e4a9e7d807..b9b88ba7564b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -577,6 +577,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);