Show process name in set_mempolicy() ignored message

Signed-off-by: Trevor Man <tman_github@trejan.com>
This commit is contained in:
Trevor Man
2025-04-02 16:48:10 +01:00
committed by Dom Cobley
parent ee391d8c6d
commit 80fe42d95d

View File

@@ -1625,6 +1625,7 @@ SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len,
static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask, static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask,
unsigned long maxnode) unsigned long maxnode)
{ {
char name[sizeof(current->comm)];
unsigned short mode_flags; unsigned short mode_flags;
nodemask_t nodes; nodemask_t nodes;
int lmode = mode; int lmode = mode;
@@ -1635,7 +1636,7 @@ static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask,
if (mempolicy_cmdline_set) { if (mempolicy_cmdline_set) {
// ignore messages during boot which are expected // ignore messages during boot which are expected
if (ktime_get_boottime_seconds() > 40) if (ktime_get_boottime_seconds() > 40)
pr_info("Request to set policy to %d ignored\n", mode); pr_info("Request by '%s' to set policy to %d ignored\n", get_task_comm(name, current), mode);
return 0; return 0;
} }