lkml.org 
[lkml]   [2017]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Pass mode to wait_on_atomic_t() action funcs and provide default actions
Date
Peter Zijlstra <peterz@infradead.org> wrote:

> > The moment atomic_dec_and_test() is called, *net is at liberty to disappear,
> > so there's no way to find a waitqueue - unless that waitqueue is guaranteed
> > not to be deallocated, eg. by being global.
>
> But any possible wait side will still need to dereference *net at an
> indeterminate point in the future to ascertain the value does now indeed
> read 0.

Yeah, the assumption is that the *wait* side is where the deallocation is
happening. So I have something like:

net->live = false; // Tell the cell managers to delete the cells
...
foreach (cell)
queue_work(cell);
...
wait_on_atomic_t(&net->cells_outstanding, atomic_t_wait,
TASK_UNINTERRUPTIBLE);
...
destroy(net);

> ... We can certainly start with your patch, as that does clean things up.

Can I put that down as a Grudgingly-acked-by?

David

\
 
 \ /
  Last update: 2017-11-02 17:46    [W:2.001 / U:1.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site