From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbdKFKX1 (ORCPT ); Mon, 6 Nov 2017 05:23:27 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:59526 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875AbdKFKXY (ORCPT ); Mon, 6 Nov 2017 05:23:24 -0500 Date: Mon, 6 Nov 2017 11:23:12 +0100 From: Peter Zijlstra To: Julia Cartwright Cc: Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, Gratian Crisan , Darren Hart Subject: Re: [PATCH] futex: Drop now unnecessary check in exit_pi_state() Message-ID: <20171106102312.GE3165@worktop.lehotels.local> References: <20171103223028.31984-1-julia@ni.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171103223028.31984-1-julia@ni.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :-)