From patchwork Sat Jan 7 00:00:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13091893 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 A4D1EC5479D for ; Sat, 7 Jan 2023 00:00:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 256E98E0002; Fri, 6 Jan 2023 19:00:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 208468E0001; Fri, 6 Jan 2023 19:00:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CEBF8E0002; Fri, 6 Jan 2023 19:00:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id F08B68E0001 for ; Fri, 6 Jan 2023 19:00:16 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C48D11A07C3 for ; Sat, 7 Jan 2023 00:00:16 +0000 (UTC) X-FDA: 80326045632.23.E972FD2 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by imf29.hostedemail.com (Postfix) with ESMTP id 251AB120011 for ; Sat, 7 Jan 2023 00:00:14 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dmtKLaut; spf=pass (imf29.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=lstoakes@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673049615; a=rsa-sha256; cv=none; b=6HM0SjgqFZRpakmFjxvn3a7KW8iKnv7XUIoeFvknLeL7ZQ0mo2EetkRkSlp6EbagINR5Re ho0Jb8kAUH9xZQ+uRCrkS1W4h31ncmLX0wyJ+OWU9YLek4OB+fOWEeYlJGdIEDIOHSbUg4 OriAHccierJn5wmRR60Wvs5IeaZOHDk= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dmtKLaut; spf=pass (imf29.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=lstoakes@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673049615; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=lWaEEzUdu0a2l69D/koc9fARtXrykhlMFd9nb9u+kTo=; b=agBzIRnNGs0PWowc9q4NywmW6vuRXGMRT0COMqsQ4poUeE+xCryF1fVUQNdOhCDml15O1A Oggk7ZPGFpXFVihvTkkWV9/ygnjLv/yVWHbyT77BpiJ9sWJPqlXUuDBFe4+pJ44IjFKKBX kVJB0h/BX8iSHoZor7cEXB9qQXHNtS0= Received: by mail-wm1-f41.google.com with SMTP id i17-20020a05600c355100b003d99434b1cfso2197526wmq.1 for ; Fri, 06 Jan 2023 16:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lWaEEzUdu0a2l69D/koc9fARtXrykhlMFd9nb9u+kTo=; b=dmtKLautw2/olGS3O9y/lbMdibf3u+VPwxPdWc64OCxiB1sCsR8NGasJE1BK/IHeni zcAlgpcWYc0bOE+V8vlYASwjOBdvvTqkK8pNggfl6z1WBGgTntz8Sg2mE473j8JsoJjL bJY95Lwk9SeCuqc6NMM65ane++HcgMCZJymi+/tOAqhUHbnxdy0G6aDP14vKuxkJKCZQ A2BnewoXb2IQyCjl0bGLXoO88gBxa/nBqu3PitB/sShiuDDQARLPPyzPM6C+cLeuv3xe ZQKnUwavzIatT3M/BzfJcYe8e6XQ2Z2hrHOv+Tv5PheC3W37mGDjbnxQJrSlKSbmXyTl IeXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lWaEEzUdu0a2l69D/koc9fARtXrykhlMFd9nb9u+kTo=; b=HzloCQviz21gdQuH0fbAVOgFHcZfTkMs89jEXHn/vgwQeP0NBwzpFbHHrBjLZlKi1i QYclu7Zy+TONAQG5Q8j4WMJX9//4ijnlidlLkW07DpYtSOeRh8MnA1lCxk3SDMtD/2n/ RxdkGDsheN6APpfqARRvm8+PxN/5Gr0JwbUhyKgtnlKf09mfoBLMo3cLazGnmykviZei gpYZzOZVdsWK99rF6hackCiB84dpIvFgoBENPbDSX6exhWLDoAFnX88ih4X0O0i9mp4q ubSgMdn+s3NCnysO06Ggg4e9h4yN8glkWwnm3cjlIsn3rbL1vAtyB9natop96jC0L5zb gekQ== X-Gm-Message-State: AFqh2ko4bmpvIVRp9gYnPZGfy5FK0NB9vuC2niNGQrTen96vwQO2bkat 56XOpEQFG3HkGq93CZbBdlxx1ebyKZs= X-Google-Smtp-Source: AMrXdXtUgnR1AWdGbs23R+6obY22Kkx+ZxsK1plTHayCpdTvom60eUQP+rm8DFF0kGxlyo9XDkX6Vg== X-Received: by 2002:a05:600c:4307:b0:3d3:494f:6a39 with SMTP id p7-20020a05600c430700b003d3494f6a39mr40925953wme.16.1673049613147; Fri, 06 Jan 2023 16:00:13 -0800 (PST) Received: from lucifer.home (host81-157-153-247.range81-157.btcentralplus.com. [81.157.153.247]) by smtp.googlemail.com with ESMTPSA id p21-20020a7bcc95000000b003c65c9a36dfsm3102234wma.48.2023.01.06.16.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 16:00:12 -0800 (PST) From: Lorenzo Stoakes To: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org Cc: Vlastimil Babka , Matthew Wilcox , David Hildenbrand , Mike Kravetz , Muchun Song , Lorenzo Stoakes Subject: [PATCH] mm: update mmap_sem comments to refer to mmap_lock Date: Sat, 7 Jan 2023 00:00:05 +0000 Message-Id: <33fba04389ab63fc4980e7ba5442f521df6dc657.1673048927.git.lstoakes@gmail.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 251AB120011 X-Stat-Signature: kuws6yj8p5j7dqsuif4tshxon4mbpgjg X-HE-Tag: 1673049614-430174 X-HE-Meta: U2FsdGVkX1/TCumcw+VkJE/nZqBmbFDJBb5jkCCVNguI94jz/HXS5QRuT8/b00Bz34qdDg7huxy7XIOHExhAvTzJHd9+EQN9zN6nRql0ETirDGU0DI3uN0/MX0iVMUM1Fzu6dd0AffjuQ3NzR0yPTR5srzaKpczNMDSH4f6oj8Dp6UWgV+Yx2WfJztH5MQ+cgUXvx5QbxOtdbCKyGxJyWu14MtOwFWrcu33D91PHKUygwsELO9nhsHGjiXsqqzptC50DgDbp3qoYoqGl9gDjez8B6QEaR9k/0utjFiOPlnYsqDJD/b0d6Y6GCiv93/j+z6ibPNpsdyT5RpVaQtlviSkAaRqD7Bf7KZ/8H5yA71HJvsEMP7aFHhxaAS+o4qXtn/DJBjaUQAAxMl9XNHvd2ze1hrOaoCW6f5hkU+3UEcPHEQtHVn28+S9nKQ6Tnpj7/jDGMkBEBnk4FuDkN1QpfWV+Na23AXXRBe8vCfHh1wU3AQC62Y77cjiFTyi8AjLthOB9NxtcjQnpioNJs7r+GyN2V/gAtMG/tDyzlSHRpj+qwtfutioLWWvQN4dWb5y04kzbLF/lEh4iYdn8qrImvb9HGt3+QE+cW1sY2z8uEU2DdRuGbQTX/ZXiTl6P3CuE4BZFs5eZNxkBHFj7uGlgx98f8UXl4M/Z37DS9e6km/6hLKNZfoi3zIXCUsTl/ZCU+VVa8DCc4uPzr8eOvxRXL3WTl3DMAQ72QZ6HD7Y7ztMO5BERKFaOcKK+Hu0Fh444JJeRpuzGRgIpXuX53+8X3VoxKwjgwF0Ol9CzEqOEvqbThNBaaXz4khXVmr8LV29AQ9d7nskjVy1GTk1guVltLLewY0maTP4IAE6EjekSKGkWQAOed+u3DDpsir/zmQuN//5F4+A4L/N5yb0txfkFyvGTBbIK7xNn4Gxu811bZKtfB6mXmEWvg1k9D8XQMtFJooQDIFk9Zl2ty/Dpimw pvgCkWy+ /UGWEydTnFbVsNFIPP5G87rjeIQuAwQTc8tkU1kKaTW7bxyD1To6XXbJruL2Qrsf1bi+6x85KUUWEXR8AcOM0k7mFtPEpeCFi5e0X4q5tJXoFbv1nsdXqaccY1lAPg5h1Up435MZK1y8bbRG00DcDeFo4zbQJb9lltXkobLIo4vvwNPM= 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: The rename from mm->mmap_sem to mm->mmap_lock was performed in commit da1c55f1b272 ("mmap locking API: rename mmap_sem to mmap_lock") and commit c1e8d7c6a7a6 ("map locking API: convert mmap_sem comments"), however some incorrect comments remain. This patch simply corrects those comments which are obviously incorrect within mm itself. Signed-off-by: Lorenzo Stoakes --- include/linux/mm_types.h | 2 +- include/linux/page_ref.h | 2 +- mm/hugetlb.c | 4 ++-- mm/madvise.c | 2 +- mm/mmap.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) -- 2.39.0 diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 7bb216b9b8d6..83f0c0c8869c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -581,7 +581,7 @@ struct vm_area_struct { /* * For private and shared anonymous mappings, a pointer to a null * terminated string containing the name given to the vma, or NULL if - * unnamed. Serialized by mmap_sem. Use anon_vma_name to access. + * unnamed. Serialized by mmap_lock. Use anon_vma_name to access. */ struct anon_vma_name *anon_name; #endif diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h index 2e677e6ad09f..d7c2d33baa7f 100644 --- a/include/linux/page_ref.h +++ b/include/linux/page_ref.h @@ -301,7 +301,7 @@ static inline bool folio_ref_try_add_rcu(struct folio *folio, int count) * * You can also use this function if you're holding a lock that prevents * pages being frozen & removed; eg the i_pages lock for the page cache - * or the mmap_sem or page table lock for page tables. In this case, + * or the mmap_lock or page table lock for page tables. In this case, * it will always succeed, and you could have used a plain folio_get(), * but it's sometimes more convenient to have a common function called * from both locked and RCU-protected contexts. diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d54336538e8e..6fe65f14d33b 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1177,7 +1177,7 @@ void hugetlb_dup_vma_private(struct vm_area_struct *vma) /* * Reset and decrement one ref on hugepage private reservation. - * Called with mm->mmap_sem writer semaphore held. + * Called with mm->mmap_lock writer semaphore held. * This function should be only used by move_vma() and operate on * same sized vma. It should never come here with last ref on the * reservation. @@ -5149,7 +5149,7 @@ static void move_huge_pte(struct vm_area_struct *vma, unsigned long old_addr, /* * We don't have to worry about the ordering of src and dst ptlocks - * because exclusive mmap_sem (or the i_mmap_lock) prevents deadlock. + * because exclusive mmap_lock (or the i_mmap_lock) prevents deadlock. */ if (src_ptl != dst_ptl) spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); diff --git a/mm/madvise.c b/mm/madvise.c index 4a33f69ad5ef..4561aaa0e46c 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -130,7 +130,7 @@ static int replace_anon_vma_name(struct vm_area_struct *vma, #endif /* CONFIG_ANON_VMA_NAME */ /* * Update the vm_flags on region of a vma, splitting it or merging it as - * necessary. Must be called with mmap_sem held for writing; + * necessary. Must be called with mmap_lock held for writing; * Caller should ensure anon_name stability by raising its refcount even when * anon_name belongs to a valid vma because this function might free that vma. */ diff --git a/mm/mmap.c b/mm/mmap.c index 19e3f0deaa42..1bafd2c04b4b 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2321,7 +2321,7 @@ static inline int munmap_sidetree(struct vm_area_struct *vma, * @start: The aligned start address to munmap. * @end: The aligned end address to munmap. * @uf: The userfaultfd list_head - * @downgrade: Set to true to attempt a write downgrade of the mmap_sem + * @downgrade: Set to true to attempt a write downgrade of the mmap_lock * * If @downgrade is true, check return code for potential release of the lock. */ @@ -2473,7 +2473,7 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, * @len: The length of the range to munmap * @uf: The userfaultfd list_head * @downgrade: set to true if the user wants to attempt to write_downgrade the - * mmap_sem + * mmap_lock * * This function takes a @mas that is either pointing to the previous VMA or set * to MA_START and sets it up to remove the mapping(s). The @len will be