diff options
author | Uladzislau Rezki (Sony) <urezki@gmail.com> | 2019-04-26 01:23:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-04-26 12:18:05 -0400 |
commit | e789803507b2e154ed452865ee981b038654e98d (patch) | |
tree | 2ce43c282b482fdcf8ecff53198193a48fb15d09 /lib/test_vmalloc.c | |
parent | ae3d6a323347940f0548bbb4b17f0bb2e9164169 (diff) |
lib/test_vmalloc.c: do not create cpumask_t variable on stack
On my "Intel(R) Xeon(R) W-2135 CPU @ 3.70GHz" system(12 CPUs) i get the
warning from the compiler about frame size:
warning: the frame size of 1096 bytes is larger than 1024 bytes [-Wframe-larger-than=]
the size of cpumask_t depends on number of CPUs, therefore just make use
of cpumask_of() in set_cpus_allowed_ptr() as a second argument.
Link: http://lkml.kernel.org/r/20190418193925.9361-1-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Roman Gushchin <guro@fb.com>
Cc: Uladzislau Rezki <urezki@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Thomas Garnier <thgarnie@google.com>
Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/test_vmalloc.c')
-rw-r--r-- | lib/test_vmalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index 83cdcaa82bf6..f832b095afba 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c | |||
@@ -383,14 +383,14 @@ static void shuffle_array(int *arr, int n) | |||
383 | static int test_func(void *private) | 383 | static int test_func(void *private) |
384 | { | 384 | { |
385 | struct test_driver *t = private; | 385 | struct test_driver *t = private; |
386 | cpumask_t newmask = CPU_MASK_NONE; | ||
387 | int random_array[ARRAY_SIZE(test_case_array)]; | 386 | int random_array[ARRAY_SIZE(test_case_array)]; |
388 | int index, i, j, ret; | 387 | int index, i, j, ret; |
389 | ktime_t kt; | 388 | ktime_t kt; |
390 | u64 delta; | 389 | u64 delta; |
391 | 390 | ||
392 | cpumask_set_cpu(t->cpu, &newmask); | 391 | ret = set_cpus_allowed_ptr(current, cpumask_of(t->cpu)); |
393 | set_cpus_allowed_ptr(current, &newmask); | 392 | if (ret < 0) |
393 | pr_err("Failed to set affinity to %d CPU\n", t->cpu); | ||
394 | 394 | ||
395 | for (i = 0; i < ARRAY_SIZE(test_case_array); i++) | 395 | for (i = 0; i < ARRAY_SIZE(test_case_array); i++) |
396 | random_array[i] = i; | 396 | random_array[i] = i; |