diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-01-13 16:57:26 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2019-01-13 16:57:26 -0500 |
commit | 0229719228b4bb76d3ead49731d0f2e1308cd310 (patch) | |
tree | b7cc84e19f9d3f79d20b25939a3ead4d05c9629c | |
parent | 52e4726b510f996d2fa45c619e9cf8770e6a6c47 (diff) |
Use 16k stack size
-rw-r--r-- | linux/kthread.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/linux/kthread.c b/linux/kthread.c index eaab31db..ce3e2a18 100644 --- a/linux/kthread.c +++ b/linux/kthread.c @@ -7,6 +7,8 @@ #include <linux/rcupdate.h> #include <linux/sched.h> +#include "tools-util.h" + enum KTHREAD_BITS { KTHREAD_IS_PER_CPU = 0, KTHREAD_SHOULD_STOP, @@ -72,7 +74,11 @@ struct task_struct *kthread_create(int (*thread_fn)(void *data), atomic_set(&p->usage, 1); init_completion(&p->exited); - ret = pthread_create(&p->thread, NULL, kthread_start_fn, p); + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 16 << 10); + + ret = pthread_create(&p->thread, &attr, kthread_start_fn, p); if (ret) die("pthread_create error %s", strerror(ret)); pthread_setname_np(p->thread, p->comm); |