mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Julia Cartwright <julia@ni.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org,
	Gratian Crisan <gratian.crisan@ni.com>,
	Darren Hart <dvhart@infradead.org>
Subject: Re: [PATCH] futex: Drop now unnecessary check in exit_pi_state()
Date: Mon, 6 Nov 2017 11:23:12 +0100	[thread overview]
Message-ID: <20171106102312.GE3165@worktop.lehotels.local> (raw)
In-Reply-To: <20171103223028.31984-1-julia@ni.com>

On Fri, Nov 03, 2017 at 05:30:28PM -0500, Julia Cartwright wrote:
> This check was an attempt to protect against a race with put_pi_state()
> by ensuring that the pi_state_list was consistent across the
> unlock/lock of pi_lock.
> 
> However, as of commit 153fbd1226fb3 ("futex: Fix more put_pi_state() vs.
> exit_pi_state_list() races"), this check is no longer necessary because
> we now hold a reference to the pi_state object across the unlock/lock of
> pi_lock.  This reference guarantees that a put_pi_state() on another CPU
> won't rip the pi_state object from the list when we drop pi_lock.

> @@ -929,17 +928,6 @@ void exit_pi_state_list(struct task_struct *curr)
>  		spin_lock(&hb->lock);
>  		raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock);
>  		raw_spin_lock(&curr->pi_lock);
> -		/*
> -		 * We dropped the pi-lock, so re-check whether this
> -		 * task still owns the PI-state:
> -		 */
> -		if (head->next != next) {

Quite possibly you're right, but I would sleep a whole lot better if
that were to remain a WARN. You never know with this futex stuff :-)

      reply	other threads:[~2017-11-06 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 22:30 Julia Cartwright
2017-11-06 10:23 ` 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=20171106102312.GE3165@worktop.lehotels.local \
    --to=peterz@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=gratian.crisan@ni.com \
    --cc=julia@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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®