public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: dhowells@redhat.com, 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, 02 Nov 2017 16:45:51 +0000	[thread overview]
Message-ID: <10660.1509641151@warthog.procyon.org.uk> (raw)
In-Reply-To: <20171101190644.chwhfpoz3ywxx2m7@hirez.programming.kicks-ass.net>

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

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 15:37 [PATCH] Pass mode to wait_on_atomic_t() action funcs and provide default actions 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 [this message]
2017-11-02 16:48         ` Peter Zijlstra

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=10660.1509641151@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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