From patchwork Thu Dec 9 19:13:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 12668099 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 E0B86C433EF for ; Thu, 9 Dec 2021 19:14:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04C476B0073; Thu, 9 Dec 2021 14:13:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3E176B0074; Thu, 9 Dec 2021 14:13:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDE476B0075; Thu, 9 Dec 2021 14:13:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id D08AD6B0073 for ; Thu, 9 Dec 2021 14:13:43 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9C4B718045C15 for ; Thu, 9 Dec 2021 19:13:33 +0000 (UTC) X-FDA: 78899204706.07.1F663E2 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf04.hostedemail.com (Postfix) with ESMTP id 3CBA440004 for ; Thu, 9 Dec 2021 19:13:33 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id t24-20020a252d18000000b005c225ae9e16so12129902ybt.15 for ; Thu, 09 Dec 2021 11:13:33 -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=lTAlULbaYci8mNxOh4U/y4HSmlvqptug37kJk1cA9ng=; b=pRDHRPMcYrCxtGkxB3Ng0Xbc+SMpiniSXxGbkaAfCCuWQBd/P2JVPToEUkZbjjcfSJ nItLlVga0Su1GkumFrTGn47hWXeln9W5o+GgE/OUu/k1oisNGMGiPHtzwodRa/fTgrcl R9YYrb0MBVbP5EEpU6YLpzbe2va8FK1QxpX/UZCezgajCHwS9h/FhlWqavV3V1Jrg2j1 KOY+FhUPMAOuEH+Gc0gnDh8Dt5MzgPa7Zgt4LGxUBu7Dn7ubuleriyOnruNicSNad2K6 lmU8xmvgcXci3Sa9QRq0bPAIuTZusIogJ/8NsaQ5Ttft5ca946nIDT6HIhylUjww+hKP hMLQ== 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=lTAlULbaYci8mNxOh4U/y4HSmlvqptug37kJk1cA9ng=; b=MJDArTFE8V44trSpgOolopTYm8icFoHyeE/o4TirDHhnOvrQQcG/16gF+av3/zo3VN G7yLii4kV3WCPvzyPz5TAsOWO64pEi6OUkxm7gt3mc9VCVarMCKbdRhdO2TT7gEcbSuL eDrFLrjHn0TWNtgn8X8CJBpLjmQhKv/E3+tnS5CW00qk9uDYMStUZJ6Oqu7joqLWnaZZ UbZtHlKH1Czs/UDzCyJOaENUm2FSXOoEIdbnG5EYqafvPJilCl3XkP7FslQ2Z8HGMEa7 29eq1pMJO4xgrr2TdYPxMwbDXknAeLYnlGo/qtTzW+VU9W2Xxwi0npMwvzfHnu1LU2Vm PCJA== X-Gm-Message-State: AOAM5303kA2lXggPfFMSptn9pNF5ehIOiuLOOjoW3RZ1KRKhLXEjwqZ1 7f8mKnqf4Jk0K5RScAgQIJAVq+7vLvQ= X-Google-Smtp-Source: ABdhPJzdHuDBifYPK8J3huuoeyqyaXkFbtBIuADiDD9zw4LaQT8yMC0PnA9+BPHRhPDjzcrj566dkfet9Bo= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:8b23:8fcc:c6e4:3a65]) (user=surenb job=sendgmr) by 2002:a05:6902:552:: with SMTP id z18mr8451407ybs.318.1639077212444; Thu, 09 Dec 2021 11:13:32 -0800 (PST) Date: Thu, 9 Dec 2021 11:13:24 -0800 In-Reply-To: <20211209191325.3069345-1-surenb@google.com> Message-Id: <20211209191325.3069345-2-surenb@google.com> Mime-Version: 1.0 References: <20211209191325.3069345-1-surenb@google.com> X-Mailer: git-send-email 2.34.1.173.g76aa8bc2d0-goog Subject: [PATCH v5 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-Stat-Signature: po6wocnmt5ix13818jcot9381xes3ffb Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=pRDHRPMc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf04.hostedemail.com: domain of 3XFWyYQYKCOMXZWJSGLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3XFWyYQYKCOMXZWJSGLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--surenb.bounces.google.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3CBA440004 X-HE-Tag: 1639077213-278903 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 --- changes in v5 - Added Acked-by 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);