From 82ea1311dc3851e5b51d95f084689b6dbb7bf425 Mon Sep 17 00:00:00 2001
From: Trevor Man <tman_github@trejan.com>
Date: Wed, 2 Apr 2025 16:48:10 +0100
Subject: [PATCH] Show process name in set_mempolicy() ignored message

Signed-off-by: Trevor Man <tman_github@trejan.com>
---
 mm/mempolicy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1625,6 +1625,7 @@ SYSCALL_DEFINE6(mbind, unsigned long, st
 static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask,
 				 unsigned long maxnode)
 {
+	char name[sizeof(current->comm)];
 	unsigned short mode_flags;
 	nodemask_t nodes;
 	int lmode = mode;
@@ -1635,7 +1636,7 @@ static long kernel_set_mempolicy(int mod
 	if (mempolicy_cmdline_set) {
 		// ignore messages during boot which are expected
 		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;
 	}
 
