forked from openzfs/spl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle interrupted kthread_create() and ENOMEM failures.
Kernels >= 3.13 can return ENOMEM from kthread_create() in both a true out of memory situation and also if the call is interrupted. Re-try the kthread_create() in these cases.
- Loading branch information
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,9 +126,12 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func, | |
tp->tp_state = state; | ||
tp->tp_pri = pri; | ||
|
||
retry: | ||
tsk = kthread_create(thread_generic_wrapper, (void *)tp, | ||
"%s", tp->tp_name); | ||
if (IS_ERR(tsk)) { | ||
if (PTR_ERR(tsk) == -ENOMEM) | ||
This comment has been minimized.
Sorry, something went wrong.
tuxoko
|
||
goto retry; | ||
SERROR("Failed to create thread: %ld\n", PTR_ERR(tsk)); | ||
SRETURN(NULL); | ||
} | ||
|
kmem_free(tqt, sizeof(taskq_thread_t));