Skip to contentSkip to conversation

workqueue flush_work() patches

DISCUSSION Max Krasnyansky 2 participants 3 messages Jun 27, 2008

lore
Share & tools
lore
#0 lore raw

Peter,
Oleg,

I'm not sure if you guys saw my last email on this. So I'll restart the thread.
If you guys are ok with the summary I provided below I can put all Oleg's patches into some git tree, test them on my boxes and resend to Andrew. I was also going to go over the users of flush_queued_work() and convert them to cancel_work_sync() and/or flush_work(). So I need to know if we want to go ahead with the flush_work() patches. Please see summary below and let me know what you guys think.

Thanx
Max

----

Quoted 3 lines · Peter Zijlstra

Anyway, I think before we go further down this road, we'd better see if anybody actually needs this. Not that theorizing about this problem isn't fun,... but... :-)

Let me see if I can sum up current state of affairs. Looks like people are in general ok with Oleg's patches. Fancier stuff is much more complex and may not be needed. Combining Oleg's patches with auditing current flush_scheduled_work() users and fixing them to use cancel_work_sync() (and in some cases flush_work()) gives us desired behaviour. Which is:
1. minimizing flush overhead
2. handling (actually avoiding) work queue thread starvation

Does that sound right ? Or did I miss something in the discussion ?

If that sounds right we should resend the patches to Andrew with formal ACKs because I do not seem them in mainline, linux-next or -mm.

Thanks
Max

#1 lore raw
Quoted 6 lines · Max Krasnyansky

I'm not sure if you guys saw my last email on this. So I'll restart the thread.
If you guys are ok with the summary I provided below I can put all Oleg's patches into some git tree, test them on my boxes and resend to Andrew.

I'll re-send these flush_work() patches to Andrew on Sunday,

Quoted 2 lines

I was also going to go over the users of flush_queued_work() and convert them to cancel_work_sync() and/or flush_work().

I think this would be very nice in any case.

but I don't think flush_work() will find a lot of users...

Oleg.

author Acked-by
#2 lore raw
Quoted 5 lines · Oleg Nesterov
Quoted 2 lines · Max Krasnyansky

I'm not sure if you guys saw my last email on this. So I'll restart the thread.
If you guys are ok with the summary I provided below I can put all Oleg's patches into some git tree, test them on my boxes and resend to Andrew.

I'll re-send these flush_work() patches to Andrew on Sunday,

Excellent. Feel free to include

Quoted 5 lines
Quoted 1 line

I was also going to go over the users of flush_queued_work() and convert them to cancel_work_sync() and/or flush_work().

I think this would be very nice in any case.

but I don't think flush_work() will find a lot of users...

Well, you've already found one (schedule_on_each_cpu()) there will probably be more. But I agree that flush is mostly used in cleanup procedures and therefor most users just need cancel_work_sync().

Max