Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1406808pxb; Fri, 26 Feb 2021 09:53:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJykrtWh7emwKXWzjzm27QD1+6wUM+HEFgueKrZV/2zK7kv3KcKTdU8EpKuGwQmN0Tv7SmKY X-Received: by 2002:a17:907:da3:: with SMTP id go35mr4596349ejc.26.1614362005243; Fri, 26 Feb 2021 09:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614362005; cv=none; d=google.com; s=arc-20160816; b=sTrsbE+KsNaTGEJdyyOOCGCkz+WdqdYNpkGmaxuwFBE7v8fOqZRGaZQ5D6YFmLBCDu 39vLHhiTjtUd1KqpEbqBsmU/Ni3BDH7X6gGPLWG47ReF50laRMVGP7muxbH73qmuKQQQ fP4YEPdoT1VSBGy5ZBH8rA6ECY4qCB8Vh6C3I/oVNz6SW0LFJl7aTZUbJOt03+mHeMLN McUXmiGV9xuMr5AOkl+eAZkfetjS45f3TO69RdJHjVEv5GnBZyZuNDy23d7894M4Hp6v jqSn3jM3tI/oBJmixqSbC91vkBFNHA1qU7qI48Eo0GBfLI3LtzhontqqcmwAiuv8Uu9B 09+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8SBUQkuVhXQ1qFT9Z0D40VLdZLWpnjPpKivFIfdozzg=; b=VtIbookD7laaYQV9LPstWJDE1/U8grKFaPcDzPLdIcY76GAuK9tYy3ye7d+sb2Z1kI yCkZCYr9Vi6Y3qEPySTv6ZCXhNJ4uZXdCHgsSW+i8aRvD7M7qg+JswikVZArWLfdXECZ DFoCECOW8XPzhXiIw5tDrUdUVjmay2R2iYGRKYb8rM/d2f0jxWizr5EBz5rU1CdweIuD 7DwjpT6RHjZxyz6gHlzeLbWuxciCkj/lN3KhxTcCenSOXSUbSFA0/VpCnl7S/jrVV5qW 8sEI3sQD7riBoKbBGc218aP/l4nDFYqDAo3B8qHdTaQ8pLrMDFDvx1IDvonfU2rffqQF BBUA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f27si6426657ejf.555.2021.02.26.09.53.01; Fri, 26 Feb 2021 09:53:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbhBZRwI (ORCPT + 99 others); Fri, 26 Feb 2021 12:52:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:54788 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbhBZRvp (ORCPT ); Fri, 26 Feb 2021 12:51:45 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 34CB4ACF6; Fri, 26 Feb 2021 17:51:04 +0000 (UTC) From: Davidlohr Bueso To: tglx@linutronix.de Cc: mingo@redhat.com, peterz@infradead.org, dvhart@infradead.org, dave@stgolabs.net, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: [PATCH 2/4] kernel/futex: Make futex_wait_requeue_pi() only call fixup_owner() Date: Fri, 26 Feb 2021 09:50:27 -0800 Message-Id: <20210226175029.50335-2-dave@stgolabs.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210226175029.50335-1-dave@stgolabs.net> References: <20210226175029.50335-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A small cleanup that allows for fixup_pi_state_owner() only to be called from fixup_owner(), and make the 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 --- kernel/futex.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index db8002dbca7a..ee09995d707b 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. -- 2.26.2