Nick, thanks for serialization suggestion.
On Thu, 2010-05-27 at 17:22 +1000, Nick Piggin wrote:
It is in mm/backing-dev.c:376 in today's Linus' tree. The -1 is used to
indicate that 'sync_supers()' is in progress and avoid arming timer in
that case. But yes, this is not really needed.
AFAIU, test_and_clear_bit assumes 2 barriers - before the test and after
the clear. Then I do not really understand why this smp_mb is needed.
AFAIU, the following should be fine, no?:
if (unlikely(!supers_timer_armed))
if (!test_and_set_bit(0, &supers_timer_armed))
bdi_arm_supers_timer();
vs
again:
sync_supers();
if (test_and_clear_bit(0, &supers_timer_armed))
goto again;
I assume that it is harmless to run 'bdi_arm_supers_timer()'
concurrently;
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--