Re: [PATCH v2] kernel/fork: Update obsolete use_mm references to kthread_use_mm
From: hongyan.xia(夏弘彦)
Date: Wed May 06 2026 - 05:30:26 EST
On 1/7/2026 4:15 PM, mingzhu.wang(王明珠) wrote:
> The comment for get_task_mm() in kernel/fork.c incorrectly
> references the deprecated function `use_mm()`, which has been renamed
> to `kthread_use_mm()` in kernel/kthread.c.
>
> This patch updates the documentation to reflect the current function
> names, ensuring accuracy when developers refer to the kernel thread
> memory context API.
>
> No functional changes were introduced.
>
> Signed-off-by: mingzhu.wang <mingzhu.wang@xxxxxxxxxxxxx>
Nit: Mingzhu Wang <mingzhu.wang@xxxxxxxxxxxxx>
> ---
> v2:
> - Unwrap the comment line in kernel/fork.c as requested by Michal Hocko.
> - Wrap commit message lines to 75 characters as suggested by David Hildenbrand.
>
> kernel/fork.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index b1f3915d5f8e..0c5f985cf369 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1356,7 +1356,7 @@ struct file *get_task_exe_file(struct task_struct *task)
> * @task: The task.
> *
> * Returns %NULL if the task has no mm. Checks PF_KTHREAD (meaning
> - * this kernel workthread has transiently adopted a user mm with use_mm,
> + * this kernel workthread has transiently adopted a user mm with kthread_use_mm,
> * to do its AIO) is not set and if so returns a reference to it, after
> * bumping up the use count. User must release the mm via mmput()
> * after use. Typically used by /proc and ptrace.
> --
> 2.34.1
Reviewed-by: Hongyan Xia <hongyan.xia@xxxxxxxxxxxxx>