Re: [PATCH] flush_work_sync vs. flush_scheduled_work Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jarek Poplawski <jarkao2@...>
Cc: Maciej W. Rozycki <macro@...>, Andy Fleming <afleming@...>, Andrew Morton <akpm@...>, Jeff Garzik <jgarzik@...>, <netdev@...>, <linux-kernel@...>
Date: Thursday, October 18, 2007 - 11:48 am

On 10/18, Jarek Poplawski wrote:
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Hmm...


Yes, it won't block, but will spin in busy-wait loop until all other works
scheduled before this work are finished. Not good. After that it really
blocks waiting for this work to complete.

And I am a bit confused. We can't use flush_workqueue() because some of the
queued work_structs may take rtnl_lock, yes? But in that case we can't use
the new flush_work_sync() helper as well, no?

If we can't just cancel the work, can't we do something like

	if (cancel_work_sync(w))
		w->func(w);

instead?


If we really the new helper, perhaps we can make it a bit better?

1. Modify insert_work() to take the "struct list_head *at" parameter instead
   of "int tail". I think this patch will also cleanup the code a bit, and
   shrink a couple of bytes from .text

2. flush_work_sync() inserts a barrier right after this work and blocks.
   We still need some retry logic to handle the queueing is in progress
   of course, but we won't spin waiting for the other works.

What do you think?

Oleg.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Wed Sep 19, 10:38 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Mon Oct 15, 8:53 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Mon Oct 15, 1:03 pm)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Tue Oct 16, 2:21 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Tue Oct 16, 1:19 pm)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Wed Oct 17, 4:58 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Thu Oct 18, 7:30 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Fri Oct 19, 7:38 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Fri Oct 19, 10:39 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Benjamin Herrenschmidt, (Fri Oct 19, 5:46 pm)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Fri Oct 19, 1:58 pm)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Fri Oct 19, 4:17 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Fri Oct 19, 8:57 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Thu Oct 18, 10:37 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Thu Oct 18, 11:31 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Thu Oct 18, 2:31 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Thu Oct 18, 7:37 am)
Re: [PATCH] flush_work_sync vs. flush_scheduled_work Re: [PA..., Oleg Nesterov, (Thu Oct 18, 11:48 am)
Re: [PATCH] flush_work_sync vs. flush_scheduled_work Re: [PA..., Maciej W. Rozycki, (Thu Oct 18, 11:58 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Benjamin Herrenschmidt, (Wed Oct 17, 5:08 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Jarek Poplawski, (Wed Oct 17, 5:09 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Andrew Morton, (Thu Sep 20, 7:53 pm)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Maciej W. Rozycki, (Fri Sep 21, 8:51 am)
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes, Andrew Morton, (Fri Sep 21, 2:42 pm)