mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Pass mode to wait_on_atomic_t() action funcs and provide default actions
Date: Thu, 2 Nov 2017 17:48:08 +0100	[thread overview]
Message-ID: <20171102164808.zelswfla2coczmhy@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <10660.1509641151@warthog.procyon.org.uk>

On Thu, Nov 02, 2017 at 04:45:51PM +0000, David Howells wrote:
> 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?

Yeah sure ;-)

      reply	other threads:[~2017-11-02 16:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 15:37 David Howells
2017-11-01 16:27 ` Peter Zijlstra
2017-11-01 18:34 ` David Howells
2017-11-01 19:06   ` Peter Zijlstra
2017-11-02 16:45   ` David Howells
2017-11-02 16:48     ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171102164808.zelswfla2coczmhy@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®