From: "Paul Menage" When using fake NUMA setup, the number of memory nodes can greatly exceed the number of CPUs. So the current limit in cpuset_common_file_write() is insufficient. PAGE_SIZE is still a bit of an arbitrary limit, but gives more breathing room. Signed-off-by: Paul Menage Cc: Paul Jackson Signed-off-by: Andrew Morton --- kernel/cpuset.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff -puN kernel/cpuset.c~cpuset-allow-a-larger-buffer-for-writes-to-cpuset-files kernel/cpuset.c --- a/kernel/cpuset.c~cpuset-allow-a-larger-buffer-for-writes-to-cpuset-files +++ a/kernel/cpuset.c @@ -1218,7 +1218,8 @@ typedef enum { FILE_TASKLIST, } cpuset_filetype_t; -static ssize_t cpuset_common_file_write(struct file *file, const char __user *userbuf, +static ssize_t cpuset_common_file_write(struct file *file, + const char __user *userbuf, size_t nbytes, loff_t *unused_ppos) { struct cpuset *cs = __d_cs(file->f_dentry->d_parent); @@ -1229,7 +1230,7 @@ static ssize_t cpuset_common_file_write( int retval = 0; /* Crude upper limit on largest legitimate cpulist user might write. */ - if (nbytes > 100 + 6 * NR_CPUS) + if (nbytes > 100 + 6 * max(NR_CPUS, MAX_NUMNODES)) return -E2BIG; /* +1 for nul-terminator */ _