+ mm-page_ownerc-use-get_task_comm-to-record-task-command-name-with-the-protection-of-task_lock.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/page_owner.c: use get_task_comm() to record task command name with the protection of task_lock()
has been added to the -mm tree.  Its filename is
     mm-page_ownerc-use-get_task_comm-to-record-task-command-name-with-the-protection-of-task_lock.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-page_ownerc-use-get_task_comm-to-record-task-command-name-with-the-protection-of-task_lock.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-page_ownerc-use-get_task_comm-to-record-task-command-name-with-the-protection-of-task_lock.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Yixuan Cao <caoyixuan2019@xxxxxxxxxxxxxxxx>
Subject: mm/page_owner.c: use get_task_comm() to record task command name with the protection of task_lock()

I noticed that it is advised to access task command name with
[gs]et_task_comm() in the comment of task_struct->comm, which is safer
with the protection of task_lock().

Relative comment in include/linux/sched.h is as follows:

/*
 * executable name, excluding path.
 *
 * - normally initialized setup_new_exec()
 * - access it with [gs]et_task_comm()
 * - lock it with task_lock()
*/

Link: https://lkml.kernel.org/r/20220420122817.67181-1-caoyixuan2019@xxxxxxxxxxxxxxxx
Signed-off-by: Yixuan Cao <caoyixuan2019@xxxxxxxxxxxxxxxx>
Cc: Yinan Zhang <zhangyinan2019@xxxxxxxxxxxxxxxx>
Cc: Jiajian Ye <yejiajian2018@xxxxxxxxxxxxxxxx>
Cc: Shenghong Han <hanshenghong2019@xxxxxxxxxxxxxxxx>
Cc: Chongxi Zhao <zhaochongxi2019@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_owner.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/mm/page_owner.c~mm-page_ownerc-use-get_task_comm-to-record-task-command-name-with-the-protection-of-task_lock
+++ a/mm/page_owner.c
@@ -168,8 +168,7 @@ static inline void __set_page_owner_hand
 		page_owner->pid = current->pid;
 		page_owner->tgid = current->tgid;
 		page_owner->ts_nsec = local_clock();
-		strlcpy(page_owner->comm, current->comm,
-			sizeof(page_owner->comm));
+		get_task_comm(page_owner->comm, current);
 		__set_bit(PAGE_EXT_OWNER, &page_ext->flags);
 		__set_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags);
 
_

Patches currently in -mm which might be from caoyixuan2019@xxxxxxxxxxxxxxxx are

tools-vm-page_owner_sortc-provide-allocator-labelling-and-update-cull-and-sort-options.patch
tools-vm-page_owner_sortc-avoid-repeated-judgments.patch
mm-page_ownerc-use-get_task_comm-to-record-task-command-name-with-the-protection-of-task_lock.patch
mm-vmalloc-fix-a-comment.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux