From patchwork Tue Apr 1 09:43:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 14034588 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 00A9BC3601A for ; Tue, 1 Apr 2025 09:44:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0C2C280002; Tue, 1 Apr 2025 05:44:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C946B280001; Tue, 1 Apr 2025 05:44:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0DF5280002; Tue, 1 Apr 2025 05:44:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 906A3280001 for ; Tue, 1 Apr 2025 05:44:35 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A92951CEB23 for ; Tue, 1 Apr 2025 09:44:35 +0000 (UTC) X-FDA: 83284990110.25.1C566A3 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf11.hostedemail.com (Postfix) with ESMTP id 0D3FB40002 for ; Tue, 1 Apr 2025 09:44:33 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="aXXfn3/r"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743500674; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=83z4TLRwHefv/TkXRUF47JWbepTQKI69P2eYN5tS3sw=; b=Cci3zs79ta26ut4+JXY26DbLzlE0VBS4oR+k/DXGEOJ1HyTD2qz46vWK4zGacbxwcVj73i 00A1EE/R8koFb2yQMUy2oy/BllUkHqyA6nGfzMmHd65Fi98pKK4HI96w1/IrtAJ5WrkteI dDBP6tXY/t+j5RE2ZaCs/jIVTKmRaeE= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="aXXfn3/r"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743500674; a=rsa-sha256; cv=none; b=jMyrg22l2gj30ksU+M1Rl3oQYsiqIdPHPjJj1jaNflTo2j5Tf9AouQKcUzaRTHAyRzRz2A TUqWfo2CrvtWxUxWVtT0BwnvXUFNhr5lsh5WIoZYJhBoHVHfYhcffS3Qnj0tmI4NxULpLt PKqfbe5GHwzOpBV2aqVfiNeJ5Z46eYI= Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-ac2bb7ca40bso1081533066b.3 for ; Tue, 01 Apr 2025 02:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743500672; x=1744105472; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=83z4TLRwHefv/TkXRUF47JWbepTQKI69P2eYN5tS3sw=; b=aXXfn3/rH37u2RwMNESoJFUI8fACPQ0jJrncvMD/0hvwwI6v/KvklPgOhwwE8Ysl5X 5KYkkVjD3MuEdclIE7MDZQq3qaTBFZP1DyGePiTxIzFw7+jd4ybeWHi0wfTPj14a2wsx 6R+GCd++WaElnfHw7qkuMZd37hVUs1mZfWG56g5JGoHa8HuZxANklpHXjvD3uVUExLeo OJVJuYpr/RpoZbdGUtp1mOu2K4X3eD8CgziIfJ97mXW413ZknJf4sbpjXT0h+ZiZotdu mokmURdkaGTjbJNfxWIGED2mScNOvucd4Fas5zXtyz5tQOU0kU/YXZUCWq0a+MgMroKJ sE5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743500672; x=1744105472; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=83z4TLRwHefv/TkXRUF47JWbepTQKI69P2eYN5tS3sw=; b=v1xCSzf++nE05eyiw8PGCaMqFDS5G7B5NtrsI4L6bfIVAmfQ+cOfr87XXFYoDaHb2w mEjKvLZCD2WU6urCArRGXyXg8+3ZZRQYOxuSRjQPsjBGIJffes3S+Z3VvuhfFzgDYOYe 77Hj2QXbH4KfngHSPCd5KfJ5sBhrqmeg4AxDU3APOb00im/xC1f0MpzpeIip+Luzg61H fjVTTkPST8zAhIubcKcE+5BtkaTHAcRR/rbFIOnoMNuBcpfoGIefiMVQ9yT/VILdRJkl Os8WTKmxZ1DJd0mqPmz8NGxrdDWv+JJkqesm9rglCmwD3u8Nftal1aqrykXYAYcU+Q/Z tJBQ== X-Gm-Message-State: AOJu0YxUkN34dXSkebk4sWUnUMXfnjR8BSWbx0V+eF4f70Czzh+95Emv 0CTYtPAR9wL0W6l4JUwNd0erqiqNYYSxeZDeWjZvb+M5RPXIrRahIfOFKabe X-Gm-Gg: ASbGnct6qILqfWAl5teWF4zgLrulNs/WHGwoc5NFC4wLZXWONfwsnirV1I/jxUMz+JP CljhhZ9xwJjmTGwCTS+0MSIzqsBL4Adnz2jxvRSfkEMBPZgeQtt/DQmZMDUymi3CIrmCmHxXTb0 4RZL7omtSvYHoR4eWa5uMDrRcurWTikYa8IGvsjn6OKR2dxRQgr0GgbrxmfCCoHFulG4iHiXMbA MTFfvzGB5f9eF/QB5y9JinBsRFL3XCfVca8y9aFP/HQIcJfMOT6QOu2RbcjUPXgn7F1SY4QhOlv npLKG8QMnYdSM5QJKs6nkU9jsR2/avW5Z3UDDf21W6ZO X-Google-Smtp-Source: AGHT+IHBhdoFCxCqO3DAw2gM+FEGGww2yGBPdIDsROHtFbx12R1BpmwK6844xd8yzgJj949PF5dbww== X-Received: by 2002:a17:907:86a0:b0:ac3:cabc:1be7 with SMTP id a640c23a62f3a-ac782e3eebemr188784766b.48.1743500672159; Tue, 01 Apr 2025 02:44:32 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac71927afe0sm751280766b.52.2025.04.01.02.44.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Apr 2025 02:44:31 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang , Lorenzo Stoakes , Jann Horn , Vlastimil Babka , Michel Lespinasse Subject: [PATCH] mm/vma: correct legacy comment in vm_[un]lock_anon_vma() Date: Tue, 1 Apr 2025 09:43:46 +0000 Message-Id: <20250401094346.25200-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0D3FB40002 X-Stat-Signature: kczdsw4bder9ai45yrxfnygwcibja8sk X-Rspam-User: X-HE-Tag: 1743500673-305320 X-HE-Meta: U2FsdGVkX1/ohAzT3ELDjFnncAWrmd1M3BX/xkitpKEhDw0Gqkrl7N/MqlJofB6sPmI3CXX9RPKee+RPBuQJcaUZDOkVUg83brfmisFSShvC2EiG6pO4qV4k8AzZ3UJKiz6QxGskNZ4CT+sOylrJSQJOSzDibww1DV1uqj+bez+fcPBU/wq0NtY08doZx8o5QriYfjfo7lR6AIoTiJZN2xTdDAsSLZQeA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iZQhMpm9jp4pRgmfEy1xGQe/rXUgY8sHC9VxqllJibc9FLC+yL8YZejft7jfgan/7bOeBjm7QopXKpOdwqVkWz1kw7cF3cVO7IsnAf9A4ZDNY/Pq3wG/3MfsYywB7+vNH+dz3i2f0AXkOpSA/Mm40qNb+VVjc6z8VpnkhopXABDOsAq2274uo2WVWYRAsRn27J5EEp0vk890C2Q3tnOWZBgwij4pbVEzUEWuf/ub4dMQVLGUZmBeQY+Ovj1bTgBK5siLNCByXIaqnKjtJKnfTnD/VPNubeCkzrCCzPqH2SlDE3dKpY6D61E5Ws3VCp7tD0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000065, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In commit bf181b9f9d8d ("mm anon rmap: replace same_anon_vma linked list with an interval tree."), the anon_vma.same_anon_vma is replaced by interval tree. But the related comment is left behind. Correct it here. Signed-off-by: Wei Yang Cc: Lorenzo Stoakes Cc: Jann Horn Cc: Vlastimil Babka Cc: Michel Lespinasse --- mm/vma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/vma.c b/mm/vma.c index 5cdc5612bfc1..1a155031f1fb 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -1989,16 +1989,16 @@ static void vm_lock_anon_vma(struct mm_struct *mm, struct anon_vma *anon_vma) { if (!test_bit(0, (unsigned long *) &anon_vma->root->rb_root.rb_root.rb_node)) { /* - * The LSB of head.next can't change from under us + * The LSB of rb_root.rb_node can't change from under us * because we hold the mm_all_locks_mutex. */ down_write_nest_lock(&anon_vma->root->rwsem, &mm->mmap_lock); /* - * We can safely modify head.next after taking the + * We can safely modify rb_root.rb_node after taking the * anon_vma->root->rwsem. If some other vma in this mm shares * the same anon_vma we won't take it again. * - * No need of atomic instructions here, head.next + * No need of atomic instructions here, rb_root.rb_node * can't change from under us thanks to the * anon_vma->root->rwsem. */ @@ -2124,14 +2124,14 @@ static void vm_unlock_anon_vma(struct anon_vma *anon_vma) { if (test_bit(0, (unsigned long *) &anon_vma->root->rb_root.rb_root.rb_node)) { /* - * The LSB of head.next can't change to 0 from under + * The LSB of rb_root.rb_node can't change to 0 from under * us because we hold the mm_all_locks_mutex. * * We must however clear the bitflag before unlocking * the vma so the users using the anon_vma->rb_root will * never see our bitflag. * - * No need of atomic instructions here, head.next + * No need of atomic instructions here, rb_root.rb_node * can't change from under us until we release the * anon_vma->root->rwsem. */