Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,8 +1625,10 @@ SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len,
static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask,
unsigned long maxnode)
{
static struct task_struct *prev_task;
char name[sizeof(current->comm)];
unsigned short mode_flags;
static int task_msgs;
nodemask_t nodes;
int lmode = mode;
int err;
Expand All @@ -1635,8 +1637,19 @@ static long kernel_set_mempolicy(int mode, const unsigned long __user *nmask,

if (mempolicy_cmdline_set) {
// ignore messages during boot which are expected
if (ktime_get_boottime_seconds() > 40)
pr_info("Request by '%s' to set policy to %d ignored\n", get_task_comm(name, current), mode);
if (ktime_get_boottime_seconds() > 40) {
if (!prev_task || prev_task != current) {
task_msgs = 0;
prev_task = current;
}
if (task_msgs < 5) {
const char *task = get_task_comm(name, current);

pr_info("Request by '%s' to set policy to %d ignored\n",
task, mode);
task_msgs++;
}
}
return 0;
}

Expand Down