From nobody Sun Feb 8 18:18:33 2026 Received: from cvsmtppost05.nm.naver.com (cvsmtppost05.nm.naver.com [114.111.35.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCBC12264AB for ; Tue, 27 Jan 2026 05:53:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.111.35.27 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769493217; cv=none; b=Cn36suFZ5ADepNtS+IdayNu516Eqfspx4GCEqdT3B4sCF43ObLiu584lDRsz6cGlK+pGh5FU3HXo3au8g0ZgaGg9n3hVhGM9icS863y5KPu0Tdo4rscH0r3/w93QLTurRSG+JM0AJfnyzel1uAev3ypIHXz1OkRYviK/bUROnok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769493217; c=relaxed/simple; bh=AUEJuWVp64JJlkuZGTU/lbb35aMFdxP3nt+OQ5aetwU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Nu0ZDYwuwaxe7NVQp0QMR6e6UOeIrXHHzqOj2kVUfPploKyY8BhC2sCx8cavutJoXVC5p0qLMQ9zLNn4/vfi6XT6knyMnmL+OsAounDvB4g5oXrSIdhnGBzULuaW0k5miYH6YTt75r50BHMorwNqTJC3ZG5AQH+hSHSyDo+Bi9Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=naver.com; spf=pass smtp.mailfrom=naver.com; dkim=pass (2048-bit key) header.d=naver.com header.i=@naver.com header.b=FnnSF3Ct; arc=none smtp.client-ip=114.111.35.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=naver.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=naver.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=naver.com header.i=@naver.com header.b="FnnSF3Ct" Received: from mvsendbo01.nm ([10.179.34.201]) by cvsmtppost05.nm.naver.com with ESMTP id mHjP5d57QeKYwC2yRtHriQ for ; Tue, 27 Jan 2026 05:53:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=naver.com; s=s20171208; t=1769493207; bh=AUEJuWVp64JJlkuZGTU/lbb35aMFdxP3nt+OQ5aetwU=; h=From:To:Subject:Date:Message-ID:From:Subject:Feedback-ID: X-Works-Security; b=FnnSF3Cts69Z0IShpXCel1UyZAlXing0K8J4+nvACe2eUg3jjh1YSRkuxC6pCttnM GfOXR+t7y+IlnHk46VZXw4j4twZ73TWdRi8+YPm1tZ5j5rronK7ohbxpiVzhIblFv6 wNyJUryPW4ti6sJKhT+Ee3nLj3wYVz0OasFrQTJq0mXkGwRGYBHQcL2RNDGu9q6/nl Aci+XOi3D7DuPkWO3L6evNQFwF48b8kAvG3Jq8ign0rLfXOeiU0SkniiQt/gtjkWlO UVk4okPetwgZZfxd6iuLaKTulSE9oQ+0hYxTAF/jW3uXapcl2zEhU5xYjaIsmzbqOj qXvhVvuf44nBQ== X-Session-ID: 3ptl+01VTsepfVkW+3ZiTQ X-Works-Send-Opt: xdYZjAJYjHmZaAKqKBmmKxbwKqpYkEljxBmwjAg= X-Works-Smtp-Source: IZbrFAvrFqJZ+Hm9KA2m+6E= Received: from JMW-Ubuntu.. ([14.38.141.199]) by cvnsmtp008.nm.naver.com with ESMTP id 3ptl+01VTsepfVkW+3ZiTQ for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 27 Jan 2026 05:53:25 -0000 From: Minu Jin To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, akpm@linux-foundation.org, david@kernel.org, kees@kernel.org Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minu Jin Subject: [PATCH] fork: clarify copy_mm() comment for kernel thread Date: Tue, 27 Jan 2026 14:53:21 +0900 Message-ID: <20260127055321.2400480-1-s9430939@naver.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The existing comment is misleading: 1. "steal a active VM" suggests this code performs the active_mm borrowing, but the actual borrowing happens in context_switch() where 'next->active_mm =3D prev->active_mm' is assigned. This code simply returns 0 to skip mm copying for kernel threads. 2. "active VM" is outdated terminology, the kernel uses "active_mm". Update the comment to accurately describe what this code does. Signed-off-by: Minu Jin --- kernel/fork.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index b1f3915d5f8e..4bfd606004db 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1566,9 +1566,10 @@ static int copy_mm(u64 clone_flags, struct task_stru= ct *tsk) tsk->active_mm =3D NULL; =20 /* - * Are we cloning a kernel thread? + * Kernel threads have no 'mm' of their own as they borrow the + * 'active_mm' from the previous process at context_switch(). * - * We need to steal a active VM for that.. + * Return 0 directly to skip the copy_mm process. */ oldmm =3D current->mm; if (!oldmm) --=20 2.43.0