Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

exit/kthread: Have kernel threads return instead of calling do_exit

In 2009 Oleg reworked[1] the kernel threads so that it is not
necessary to call do_exit if you are not using kthread_stop(). Remove
the explicit calls of do_exit and complete_and_exit (with a NULL
completion) that were previously necessary.

[1] 63706172f332 ("kthreads: rework kthread_stop()")
Link: https://lkml.kernel.org/r/20211020174406.17889-12-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

+6 -9
+2 -2
drivers/firmware/stratix10-svc.c
··· 520 520 * physical address of memory block reserved by secure monitor software at 521 521 * secure world. 522 522 * 523 - * svc_normal_to_secure_shm_thread() calls do_exit() directly since it is a 523 + * svc_normal_to_secure_shm_thread() terminates directly since it is a 524 524 * standlone thread for which no one will call kthread_stop() or return when 525 525 * 'kthread_should_stop()' is true. 526 526 */ ··· 544 544 } 545 545 546 546 complete(&sh_mem->sync_complete); 547 - do_exit(0); 547 + return 0; 548 548 } 549 549 550 550 /**
+1 -1
drivers/soc/ti/wkup_m3_ipc.c
··· 426 426 else 427 427 m3_ipc_state = m3_ipc; 428 428 429 - do_exit(0); 429 + return 0; 430 430 } 431 431 432 432 static int wkup_m3_ipc_probe(struct platform_device *pdev)
+1 -4
fs/ocfs2/journal.c
··· 1497 1497 if (quota_enabled) 1498 1498 kfree(rm_quota); 1499 1499 1500 - /* no one is callint kthread_stop() for us so the kthread() api 1501 - * requires that we call do_exit(). And it isn't exported, but 1502 - * complete_and_exit() seems to be a minimal wrapper around it. */ 1503 - complete_and_exit(NULL, status); 1500 + return status; 1504 1501 } 1505 1502 1506 1503 void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num)
+1 -1
kernel/kthread.c
··· 433 433 * If thread is going to be bound on a particular cpu, give its node 434 434 * in @node, to get NUMA affinity for kthread stack, or else give NUMA_NO_NODE. 435 435 * When woken, the thread will run @threadfn() with @data as its 436 - * argument. @threadfn() can either call do_exit() directly if it is a 436 + * argument. @threadfn() can either return directly if it is a 437 437 * standalone thread for which no one will call kthread_stop(), or 438 438 * return when 'kthread_should_stop()' is true (which means 439 439 * kthread_stop() has been called). The return value should be zero
+1 -1
net/batman-adv/tp_meter.c
··· 890 890 891 891 batadv_tp_vars_put(tp_vars); 892 892 893 - do_exit(0); 893 + return 0; 894 894 } 895 895 896 896 /**