Re: [PATCH] make cancel_rearming_delayed_work() reliable

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jarek Poplawski
Date: Friday, May 18, 2007 - 12:35 am

On Wed, May 16, 2007 at 10:52:03PM +0400, Oleg Nesterov wrote:
...

Hi,

I managed to find some time to look at this all once more,
and here is my current opinion:

1. I think this above mentioned lock vs. barrier behavior is
in compliance with memory-barriers.txt, and BTW I'd like to
thank and congratulate David Howells of very good style
(and beautiful pictures).

2. IMHO the current solution with smp barriers is very good:
these barriers are really needed and they should be enough.
Oleg repeats all the time he hates barriers, but I think
it's wrong approach - they should be seen as something
natural for programming modern processors and trying to
change the code only to avoid them is wrong (unless it
could be done with some minor changes).

3. The alternative solution without barriers, based on the
idea of Tejun Heo and presented in the patch proposal from
2007-05-13, could be probably a little faster (for some
processors), after some changes:

- I think, instead of separate __set_bit and __clear_bit,
WORK_STRUCT_QUEUED bit should be changed during set_wq_data
(additional parameter or new variant eg: set_wq_data_queued),
and similarly something like  work_clear_pending_queued -
so, without additional operations instead of these barriers.

- changing this if condition in try_to_grab_pending.

But there is a question - is this worth of one (last) bit
occupied only for optimisation (but not always)?

So, maybe it would be better to think about solving those
other problems in workqueue, mentioned by Oleg somewhere?

Regards,
Jarek P.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Thu May 3, 1:42 pm)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Fri May 4, 10:09 am)
[PATCH] make-cancel_rearming_delayed_work-reliable-fix, Oleg Nesterov, (Sat May 5, 2:32 pm)
Re: [PATCH] make-cancel_rearming_delayed_work-reliable-fix, Jarek Poplawski, (Mon May 7, 3:31 am)
Re: [PATCH] make-cancel_rearming_delayed_work-reliable-fix, Anton Vorontsov, (Mon May 7, 4:55 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Tue May 8, 12:15 am)
Re: [PATCH] make-cancel_rearming_delayed_work-reliable-fix, Jarek Poplawski, (Tue May 8, 2:16 am)
Re: [PATCH] make-cancel_rearming_delayed_work-reliable-fix, Jarek Poplawski, (Tue May 8, 6:07 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Tue May 8, 6:56 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Tue May 8, 7:12 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Tue May 8, 7:32 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Fri May 11, 6:47 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Fri May 11, 7:53 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Sun May 13, 12:27 pm)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Sun May 13, 2:25 pm)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Mon May 14, 12:44 pm)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Tue May 15, 6:09 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Tue May 15, 3:00 pm)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Tue May 15, 3:08 pm)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Tue May 15, 10:21 pm)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Oleg Nesterov, (Wed May 16, 11:52 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Fri May 18, 12:35 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Fri May 18, 1:13 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Mon May 21, 12:00 am)
Re: [PATCH] make cancel_rearming_delayed_work() reliable, Jarek Poplawski, (Mon May 21, 3:10 am)