Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp608432pxf; Thu, 11 Mar 2021 10:26:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7TJ996O06usUNdRUCrhokNIOjV3PYCFKfn9e0Cl+dzHerm7wcUQezWAA/vsP8lP7XlFel X-Received: by 2002:a17:906:3052:: with SMTP id d18mr4503865ejd.530.1615487217809; Thu, 11 Mar 2021 10:26:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615487217; cv=none; d=google.com; s=arc-20160816; b=VQ3Tpe8VQeml/BLMuQ0kYAtfwkXwa43DT3jLdEMzc2GabFjzUNz13Dfl8BrhODtlIx AOgtTFwMwXhaa0O3Mpb9+2edn47SxBCaCSYORrSQL2YDm72EfTCRK3kai3kVOMhWxTvn pfWUQ2AyZkeOmRd42FcApm8pxVsJbJXP7foAujC5HzESm6s2eMCnAE907gF9lbEYlAKg TJC2yQixTlH4p/sVopdPOj0S6xBQBT11B2wL+KfY9pygj6DHA0tAzYLGsxFhrhyf2XG0 MJoASpgTw667qenKMCcZsAEi5XLg7N4tFgC7sT9kS7vQ7ht+6PWz6H2KsjJWOay5LEGY PG2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=MFFI5niyZ0UdsuRODCyNQNgbt1OUAgQ5UrgUr6IKoTQ=; b=XBREbuiqPjzl7lBDLqZBWrPM4iP3Oc/NR0gSrIPlMLrzgqOL3pPzTDbKvvgUcSTNyA wUF//UvgL8Kfj/EKvUSGNarLkpZA7aWtSKhnYq8l8CiWOJpZy+L84/FAobDwjcA7302Z uFdGTLoqzv6g7EkJVb9hM2jcy+3rUpepL65uEnmh8ngiWst/HPXy5QG3pQuECkAOW94N vPVHI7w3y0/dcEbtqAMs1q8V5j2APCNrT/yGvMk3gGueN+Rud45dmj1evoxSs+yOwtnG WyU36MM6gwWGGN7xNI21KwKSZHu0D2jiS9KWAF3PsZnAOqyR/+hc7hc+vyQSuiw2ihLM 7q0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=m9WeIucQ; dkim=neutral (no key) header.i=@linutronix.de header.b=yXoYqiYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si2195875edu.40.2021.03.11.10.26.34; Thu, 11 Mar 2021 10:26:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=m9WeIucQ; dkim=neutral (no key) header.i=@linutronix.de header.b=yXoYqiYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbhCKSZ0 (ORCPT + 99 others); Thu, 11 Mar 2021 13:25:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbhCKSY6 (ORCPT ); Thu, 11 Mar 2021 13:24:58 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B960C061760; Thu, 11 Mar 2021 10:24:58 -0800 (PST) Date: Thu, 11 Mar 2021 18:24:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1615487095; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MFFI5niyZ0UdsuRODCyNQNgbt1OUAgQ5UrgUr6IKoTQ=; b=m9WeIucQ0fRHWr53i8u+o6PNwisxBCmL4oA+WledZ0opqqlnMB1u1Oa1sLfJdrELct05ku jPtstZhFB1Uj8Pd83zBbIw9tj4h6WtLB43VNe0Xxe2Y6ebyFWn9DG2krwy8pPt6AmCpXnL hASj5RtehhH7VAZDRVdHbJLuO8EgFH/zU9rp1rgyJ5RyqaHoo+CWR8DNX3fbOBnazhD+lG RDCymjJJdQn9Sv/6GlcNtrG967AUZntwhEgxm3NJzCxlrkN50u+gHn6+V68oyCcdjkMMlt vnKzkd3g1kHu8UddZbIY4mnoCCQlhngQx62jLvUFL5A0Kb+QMVKyl0ZNFwEKng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1615487095; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MFFI5niyZ0UdsuRODCyNQNgbt1OUAgQ5UrgUr6IKoTQ=; b=yXoYqiYIqNeN0+MCHMH5mlywvzw3YiCP9X92BIPe0LfUdJxvc8M3PXbAMF4mYYbKLpPGpd /6bzOG+PE33zROAw== From: "tip-bot2 for Davidlohr Bueso" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] kernel/futex: Make futex_wait_requeue_pi() only call fixup_owner() Cc: Davidlohr Bueso , Thomas Gleixner , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210226175029.50335-2-dave@stgolabs.net> References: <20210226175029.50335-2-dave@stgolabs.net> MIME-Version: 1.0 Message-ID: <161548709514.398.3019777443206037709.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: a1565aa4699847febfdfd6af3bf06ca17a9e16af Gitweb: https://git.kernel.org/tip/a1565aa4699847febfdfd6af3bf06ca17a9e16af Author: Davidlohr Bueso AuthorDate: Fri, 26 Feb 2021 09:50:27 -08:00 Committer: Thomas Gleixner CommitterDate: Thu, 11 Mar 2021 19:19:17 +01:00 kernel/futex: Make futex_wait_requeue_pi() only call fixup_owner() A small cleanup that allows for fixup_pi_state_owner() only to be called from fixup_owner(), and make requeue_pi uniformly call fixup_owner() regardless of the state in which the fixup is actually needed. Of course this makes the caller's first pi_state->owner != current check redundant, but that should't really matter. Signed-off-by: Davidlohr Bueso Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20210226175029.50335-2-dave@stgolabs.net --- kernel/futex.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index db8002d..ee09995 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -3241,15 +3241,14 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, * reference count. */ - /* Check if the requeue code acquired the second futex for us. */ + /* + * Check if the requeue code acquired the second futex for us and do + * any pertinent fixup. + */ if (!q.rt_waiter) { - /* - * Got the lock. We might not be the anticipated owner if we - * did a lock-steal - fix up the PI-state in that case. - */ if (q.pi_state && (q.pi_state->owner != current)) { spin_lock(q.lock_ptr); - ret = fixup_pi_state_owner(uaddr2, &q, current); + ret = fixup_owner(uaddr2, &q, true); /* * Drop the reference to the pi state which * the requeue_pi() code acquired for us.