diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-10-25 10:54:09 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-10-25 10:54:09 +0200 |
commit | 0216ded72db896b24cbdd8cd6531482571b25cf6 (patch) | |
tree | 56b578e29657bd3df8236c5f0cf6b8f13c17232a /kernel/task_work.c | |
parent | 52345d35622026b99271edc1c58ad7cfef3b7567 (diff) | |
parent | 04177158cf98a79744937893b100020d77e6f9ac (diff) |
Merge branch 'topic/compress-accel' into for-next
Pull compress-offload API extension for accel operation mode
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'kernel/task_work.c')
-rw-r--r-- | kernel/task_work.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/task_work.c b/kernel/task_work.c index 5d14d639ac71..c969f1f26be5 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -55,15 +55,26 @@ int task_work_add(struct task_struct *task, struct callback_head *work, enum task_work_notify_mode notify) { struct callback_head *head; + int flags = notify & TWA_FLAGS; + notify &= ~TWA_FLAGS; if (notify == TWA_NMI_CURRENT) { if (WARN_ON_ONCE(task != current)) return -EINVAL; if (!IS_ENABLED(CONFIG_IRQ_WORK)) return -EINVAL; } else { - /* record the work call stack in order to print it in KASAN reports */ - kasan_record_aux_stack(work); + /* + * Record the work call stack in order to print it in KASAN + * reports. + * + * Note that stack allocation can fail if TWAF_NO_ALLOC flag + * is set and new page is needed to expand the stack buffer. + */ + if (flags & TWAF_NO_ALLOC) + kasan_record_aux_stack_noalloc(work); + else + kasan_record_aux_stack(work); } head = READ_ONCE(task->task_works); |