Re: [PATCH, RFC] kthread: (possibly) a missing memory barrier in kthread_stop()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Adamushko
Date: Tuesday, February 19, 2008 - 2:53 am

On 19/02/2008, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

Yes, but only when it's used in combination with something that alters
a state of the task.

So it's rather a question of the interface-design.

We currently impose a requirement on how a main loop of 'kthread'
threads (ok, so it seems to dictate a policy :-) has to be orginized.
Namely, the following sequence must be kept in order:

(1) set_current_task(TASK_INTERRUPTIBLE);
(2) kthread_should_stop()
...
- schedule()

and (1) already provides a mb which becomes a "matching barrier" on
the kthread_should_stop() side.


-- 
Best regards,
Dmitry Adamushko
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH, RFC] kthread: (possibly) a missing memory barrier ..., Dmitry Adamushko, (Mon Feb 18, 4:03 pm)
Re: [PATCH, RFC] kthread: (possibly) a missing memory barr ..., Dmitry Adamushko, (Tue Feb 19, 2:53 am)