From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 823CAC432BE for ; Wed, 11 Aug 2021 12:27:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 684876101D for ; Wed, 11 Aug 2021 12:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237961AbhHKM1d (ORCPT ); Wed, 11 Aug 2021 08:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231698AbhHKMZw (ORCPT ); Wed, 11 Aug 2021 08:25:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF5F6C061382 for ; Wed, 11 Aug 2021 05:23:43 -0700 (PDT) Message-ID: <20210811121417.590136432@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628684622; h=from:from: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: references:references; bh=9snN8xer+lJKJI12sG/6cncJ9Ea2JsEyaBt7/r26lmo=; b=cNSlBXdTvTuYYj9fmDfEmlzf1uYmt0/YX7YE1VJQFbwoRQ5U5U9fjTdwyg953oAflX5MRn 2REunNRzPfqIYlG5lqOy750oSMsOY3Um6xaTSmFjpXHwzdqaIuR+/+00Seh5Qqo7ygKYPt uf2drcYbbHjpHU5zL/tEO/qSR3x5e1urKsWLFIn8QDLkLXEE5N+nlZHGVQiSgZmYLfDjF3 f/saULNq/t/ivGuMuXx+A8gsaWJ1ljUUZQ5ZO9pmRHaZkzKBTlAUdYJx8wtNr8VrHhRiBO Q/CAR7PghwBrK7V3Kgyk4NJsprSvYCKENhedH24JTSjZ9K5/342PWTxzJYBfXg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628684622; h=from:from: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: references:references; bh=9snN8xer+lJKJI12sG/6cncJ9Ea2JsEyaBt7/r26lmo=; b=5AQ0ENmaUwW0Zw8vWDLs3+loNZC1K8DJ2mIa71akzE7xsu3yN27OvopnDaqEtooGgNHwfY wlsOCNdlLBCONpCA== From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , Sebastian Andrzej Siewior , Davidlohr Bueso , Mike Galbraith Subject: [patch V4 58/68] futex: Remove bogus condition for requeue PI References: <20210811120348.855823694@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Date: Wed, 11 Aug 2021 14:23:42 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For requeue PI it's required to establish PI state for the PI futex to which waiters are requeued. This either acquires the user space futex on behalf of the top most waiter on the inner 'waitqueue' futex or attaches to the PI state of an existing waiter or creates on attached to the owner of the futex. This code can retry in case of failure, but retry can never happen when the pi state was successfully created. The condition to run this code is: (task_count - nr_wake) < nr_requeue which is always true because: task_count = 0 nr_wake = 1 nr_requeue >= 0 Remove it all together. Signed-off-by: Thomas Gleixner --- V4: New patch --- kernel/futex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/futex.c +++ b/kernel/futex.c @@ -2000,7 +2000,7 @@ static int futex_requeue(u32 __user *uad } } - if (requeue_pi && (task_count - nr_wake < nr_requeue)) { + if (requeue_pi) { struct task_struct *exiting = NULL; /*