From a2d4c71d1559426155e5da8db3265bfa0d8d398d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 27 Jun 2012 11:33:29 +0400 Subject: deal with task_work callbacks adding more work It doesn't matter on normal return to userland path (we'll recheck the NOTIFY_RESUME flag anyway), but in case of exit_task_work() we'll need that as soon as we get callbacks capable of triggering more task_work_add(). Signed-off-by: Al Viro --- kernel/task_work.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'kernel/task_work.c') diff --git a/kernel/task_work.c b/kernel/task_work.c index fb396089f66a..91d4e1742a0c 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -60,19 +60,21 @@ void task_work_run(void) struct task_struct *task = current; struct callback_head *p, *q; - raw_spin_lock_irq(&task->pi_lock); - p = task->task_works; - task->task_works = NULL; - raw_spin_unlock_irq(&task->pi_lock); + while (1) { + raw_spin_lock_irq(&task->pi_lock); + p = task->task_works; + task->task_works = NULL; + raw_spin_unlock_irq(&task->pi_lock); - if (unlikely(!p)) - return; + if (unlikely(!p)) + return; - q = p->next; /* head */ - p->next = NULL; /* cut it */ - while (q) { - p = q->next; - q->func(q); - q = p; + q = p->next; /* head */ + p->next = NULL; /* cut it */ + while (q) { + p = q->next; + q->func(q); + q = p; + } } } -- cgit v1.2.3 /linux/netfilter_ipv6/ip6t_mark.h?id=2cca775baecbfede2fec20c99add709232311fe7'>treecommitdiffstats
AgeCommit message (Expand)AuthorFilesLines
2008-04-18x86: kgdb build fixHarvey Harrison1-2/+2
2008-04-18[SCSI] iscsi: bidi support for iscsi_tcpBoaz Harrosh1-14/+17
2008-04-18[SCSI] iscsi: bidi support at the generic libiscsi levelBoaz Harrosh1-15/+70
2008-04-18[SCSI] iscsi: extended cdb supportBoaz Harrosh2-7/+54
2008-04-18[SCSI] zfcp: Fix error handling for blocked unit for send FCP commandChristof Schmitt1-1/+1
2008-04-18[SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlockChristof Schmitt1-1/+0
2008-04-18[SCSI] zfcp: fix 31 bit compile warningsMartin Peschke11-213/+211
2008-04-18[SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commandsFUJITA Tomonori1-2/+0
2008-04-18[SCSI] bsg: remove minor in struct bsg_deviceFUJITA Tomonori1-6/+4
2008-04-18[SCSI] bsg: use better helper list functionsFUJITA Tomonori1-8/+6
2008-04-18[SCSI] bsg: replace kobject_get with blk_get_queueFUJITA Tomonori1-2/+7
2008-04-18[SCSI] bsg: takes a ref to struct device in fops->openFUJITA Tomonori1-6/+13
2008-04-18ocfs2/net: Add debug interface to o2netSunil Mushran6-3/+569
2008-04-18ocfs2: Only build ocfs2/dlm with the o2cb stack moduleMark Fasheh1-1/+1
2008-04-18ocfs2/cluster: Get rid of arguments to the timeout routinesJeff Mahoney1-27/+20
2008-04-18ocfs2: Put tree in MAINTAINERSJoel Becker1-0/+1
2008-04-18ocfs2: Use BUG_ONJulia Lawall2-4/+2
2008-04-18ocfs2: Convert ocfs2 over to unlocked_ioctlAndi Kleen3-13/+6
2008-04-18ocfs2: Improve rename lockingJan Kara1-1/+1
2008-04-18fs/ocfs2/aops.c: test for IS_ERR rather than 0Julia Lawall1-3/+3
2008-04-18ocfs2: Add inode stealing for ocfs2_reserve_new_inodeTao Ma6-5/+116
2008-04-18ocfs2: Add ac_alloc_slot in ocfs2_alloc_contextTao Ma3-0/+4
2008-04-18ocfs2: Add a new parameter for ocfs2_reserve_suballoc_bitsTao Ma1-4/+18
2008-04-18ocfs2: Enable cross extent block merge.Tao Ma1-8/+86
2008-04-18ocfs2: Add support for cross extent blockTao Ma1-41/+325
2008-04-18ocfs2: Move /sys/o2cb to /sys/fs/o2cbMark Fasheh4-0/+40
2008-04-18sysfs: Allow removal of symlinks in the sysfs rootMark Fasheh1-1/+8
2008-04-18ocfs2: Reconnect after idle time out.Tao Ma2-15/+38
2008-04-18ocfs2/dlm: Cleanup lockres printSunil Mushran1-11/+11
2008-04-18ocfs2/dlm: Fix lockname in lockres print functionSunil Mushran1-75/+51
2008-04-18ocfs2/dlm: Move dlm_print_one_mle() from dlmmaster.c to dlmdebug.cSunil Mushran3-160/+85
2008-04-18ocfs2/dlm: Dumps the purgelist into a debugfs fileSunil Mushran2-0/+72
2008-04-18ocfs2/dlm: Dumps the mles into a debugfs fileSunil Mushran2-0/+120
2008-04-18ocfs2/dlm: Move struct dlm_master_list_entry to dlmcommon.hSunil Mushran2-37/+35
2008-04-18ocfs2/dlm: Dumps the lockres' into a debugfs fileSunil Mushran2-0/+255
2008-04-18ocfs2/dlm: Dump the dlm state in a debugfs fileSunil Mushran4-0/+325
2008-04-18ocfs2/dlm: Create debugfs dirsSunil Mushran4-2/+125
2008-04-18ocfs2/dlm: Link all lockres' to a tracking listSunil Mushran3-0/+26
2008-04-18ocfs2/dlm: Create slabcaches for lock and lockresSunil Mushran4-17/+99
2008-04-18ocfs2/dlm: Rename slabcache dlm_mle_cache to o2dlm_mleSunil Mushran2-2/+4