From patchwork Sat Dec 14 03:00:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinliang Zheng X-Patchwork-Id: 13908262 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 44F3EE7717F for ; Sat, 14 Dec 2024 03:00:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7DEA6B0089; Fri, 13 Dec 2024 22:00:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A2D976B008A; Fri, 13 Dec 2024 22:00:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F52F6B008C; Fri, 13 Dec 2024 22:00:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 719F56B0089 for ; Fri, 13 Dec 2024 22:00:58 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D3E1C81589 for ; Sat, 14 Dec 2024 03:00:57 +0000 (UTC) X-FDA: 82892061756.30.BA3C392 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf20.hostedemail.com (Postfix) with ESMTP id 591CE1C0013 for ; Sat, 14 Dec 2024 03:00:28 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Boi1deWj; spf=pass (imf20.hostedemail.com: domain of alexjlzheng@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=alexjlzheng@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=1734145238; 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=ZM9tq16lU7xfYZ3fQtKg9WeMf5EZFK62A2HYIHVvwM0=; b=ZuUrg58mFeQ97cQH3+dndKdTJIsNToQXqfdrZBwy3F6M4vypQicwPpWVzDeWBLzgQ+lQ1d aZc0udaWnaZuhJefFUguzP+Xsnpt3slL1QDpw2R6kYwOdcpI0PikWqla7wvOH960YUSXME kg3FyclUGtcUFgIjyr5DouZrCmN7SwU= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Boi1deWj; spf=pass (imf20.hostedemail.com: domain of alexjlzheng@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=alexjlzheng@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734145238; a=rsa-sha256; cv=none; b=aTrETBYTTiFlgmATlBaHyd3LWadZPKG+1sp7cFbXwvQ4wnLyXhAAzGo2bivkmhGSXGCrvi wn1Je+AR9rjrIiuN95Pl6AAS+AFc/SrrhclBYh1GeQOjN7MAPO3buXXzjsHfy0uIMuIafE /CpKUKgxAoad/uoIpSwe3gyIWw/UpmQ= Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-216281bc30fso26535585ad.0 for ; Fri, 13 Dec 2024 19:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734145255; x=1734750055; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZM9tq16lU7xfYZ3fQtKg9WeMf5EZFK62A2HYIHVvwM0=; b=Boi1deWjY7Wl/W3nGdyX09IM2R1h/V126j59Ux2DF7V6OzxnxSl0aBU1btcBCeecEZ l4G/SRfFNC3EnAaT85poMAb5GGfJMPmjenBtsxoc1odsaNp6AvzPUK0UguBGQmQ4m4Se W96ZUbcz0TbR2wLmvhENkJ8oNJfHpVphepLwGAjHkybshE88Uu4cTRmjtoBI0pYEj8A7 u1Cx9zxdGqZJXUaeDqvp3ZxFKStHqYhTnVh8uQEOTajMmRApuE/A2r6aPA0JpneHnEVr /RYN/y429y/Ed9p62VcK3PQQy2liVkL9ch3ZCx3peAdUyExvMBIkjVw5Ksi4JTk8S60E gVxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734145255; x=1734750055; 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=ZM9tq16lU7xfYZ3fQtKg9WeMf5EZFK62A2HYIHVvwM0=; b=aAo+DivTgzLaBjW5Q0IjSOj8wPjP2TLv9tG6QJFVnGOcYgHVCDu5pzVWSEmsKjhag+ FkgCZuIZ/1LU7Bd9Erk39CpwOfpfWTWSDXOY9L/RFOgxBbMd44Nlkq6SK+fHQcul0Mce 0hywwupHQcvy3oexb+QnhnipHbHDz4jZA4KskjlTcRTBob23B+nkPreVvdopeqj8TsoW 1TZ8r2BQNzXGH5tQRgtpIyrdmiZx3YknRI5l5ohau/i5/8CyZa+CVp0IRGCW+pCmDsF5 kgJVO8jpx4MFfKst/I5jE6mNqEAUDmUrMPBRP3LNKTU2SmZSdIx+OLQYUnHGg7D8KXNq OdvA== X-Gm-Message-State: AOJu0YyJ+N+PHB3A0uoSQ1ktmrnBaYtD1LWen2vYO34RUAXNELL/AmMl 81Cc0OpcKvDz11F3gfhvJmxMyO4RRI7UUB6V9shN/VF2Adqa01f4 X-Gm-Gg: ASbGncsndZzKyZmLWsxdjY71qd2GybB2tKvrC/6lB5iwNhZC9c6WtJ4FTpHs9OBUGY3 S8L08FRaHMGmTsIcqo/Q0Var52pUx71bvVtD2wVCzHknLcM32kUH6e83mQrwwaKDZLbKi4SaTCU bcYc38QQpxKazPvcYb98wC0cUWrGBl9uCokJZRZW3MVHkr1r4uHGRKqHW62RFK+iu5TmMRWEw4H j6JX0bgcj21MY54GHuDfgp2EVdFf1ALC/7yF4DbbIf/+3/LsnqWtSaTSTbKH/UipW5YdnK7 X-Google-Smtp-Source: AGHT+IE1RY52apvNH4/yTyRcE0FgmMS/DeJyCmrR14TXSXuKCpFh/dhc8sPh+qKyOnQ4fOZLB//1BA== X-Received: by 2002:a17:903:41c5:b0:216:1cfa:2bda with SMTP id d9443c01a7336-21892ab824emr66805165ad.43.1734145254677; Fri, 13 Dec 2024 19:00:54 -0800 (PST) Received: from localhost.localdomain ([119.28.17.178]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-801d5a91ec5sm446330a12.6.2024.12.13.19.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 19:00:54 -0800 (PST) From: Jinliang Zheng X-Google-Original-From: Jinliang Zheng To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jinliang Zheng Subject: [PATCH v2] mm: fix outdated incorrect code comments for handle_mm_fault() Date: Sat, 14 Dec 2024 11:00:50 +0800 Message-ID: <20241214030050.1702776-1-alexjlzheng@tencent.com> X-Mailer: git-send-email 2.41.1 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: ik8pcfsx964mj1jgnj6c115wizx8nuau X-Rspamd-Queue-Id: 591CE1C0013 X-Rspam-User: X-HE-Tag: 1734145228-377306 X-HE-Meta: U2FsdGVkX198x9lzabivLTFEe8YmoC9wIA988Qtq1n3kIRiP/9fZG8OajF2jFzoXtC1JwQ49bpyeCRaJIL0i5r9gNZnrE0S1v0Sv7Aa3MQskyI6+30UwVj649/Mg3e8jmQ6NaPxJpTQiIUJz9lBjXDUbbxODrgaW/sOMgMvyIaWIPe4jBkalMraXVnAidQupzP+r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A/8oLHYdoSMjkYqm5jb40fiD/JmA9SORaB8q0owh8PltN1plEU0Ux9w9I/iRHPIKMNL4AvKYBlKa0Q+AuSnwRQ4CioqT+kdvI68WyALqXecfkCtbCSYt5rFUGdwarA2ZSmEkpq30Awmsz6hV7r1/nFYCobPqPjEaqkbjEvchErzsMdgbZ+v5wfPMymjb2HN8CKVYU+3aANCKJ8SwEPI/oj5 X-Bogosity: Unsure, tests=bogofilter, spamicity=0.458301, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Signed-off-by: Jinliang Zheng Reviewed-by: Liam R. Howlett --- changelog: - v2: lower case mmap_Lock to mmap_lock - v1: https://lore.kernel.org/linux-mm/20241213031820.778342-1-alexjlzheng@tencent.com/#r --- mm/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index d9af83dd86bb..9d64e02341f8 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6159,7 +6159,8 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma, } /* - * By the time we get here, we already hold the mm semaphore + * By the time we get here, we already hold either the VMA lock or the + * mmap_lock (FAULT_FLAG_VMA_LOCK tells you which). * * The mmap_lock may have been released depending on flags and our * return value. See filemap_fault() and __folio_lock_or_retry().