Re: [PATCH 1/3] kthread: allow caller to pass in user_struct

From: kernel test robot
Date: Thu Jun 24 2021 - 00:35:07 EST


Hi Mike,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linux/master linus/master v5.13-rc7]
[cannot apply to next-20210623]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Mike-Christie/kthread-pass-in-user-and-check-RLIMIT_NPROC/20210624-110925
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/9b4a744e588ed25e06eed415174977e7533b24dc
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mike-Christie/kthread-pass-in-user-and-check-RLIMIT_NPROC/20210624-110925
git checkout 9b4a744e588ed25e06eed415174977e7533b24dc
# save the attached .config to linux build tree
make W=1 ARCH=um SUBARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
kernel/kthread.c: In function 'kthread_create_for_user':
>> kernel/kthread.c:466:6: warning: function 'kthread_create_for_user' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
466 | namefmt, args);
| ^~~~~~~


vim +466 kernel/kthread.c

443
444 /**
445 * kthread_create_for_user - create a kthread and check @user's RLIMIT_NPROC
446 * @threadfn: the function to run until signal_pending(current).
447 * @data: data ptr for @threadfn.
448 * @user: user_struct that will have its RLIMIT_NPROC checked
449 * @namefmt: printf-style name for the thread.
450 *
451 * This will create a kthread on the current node, leaving it in the stopped
452 * state. This is just a helper for kthread_create_on_node() that will check
453 * @user's process count against its RLIMIT_NPROC. See the
454 * kthread_create_on_node() documentation for more details.
455 */
456 struct task_struct *kthread_create_for_user(int (*threadfn)(void *data),
457 void *data,
458 struct user_struct *user,
459 const char namefmt[], ...)
460 {
461 struct task_struct *task;
462 va_list args;
463
464 va_start(args, namefmt);
465 task = __kthread_create_on_node(threadfn, data, NUMA_NO_NODE, user,
> 466 namefmt, args);
467 va_end(args);
468
469 return task;
470 }
471 EXPORT_SYMBOL(kthread_create_for_user);
472

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip