Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1763197pxt; Sun, 8 Aug 2021 00:24:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5qtMZVTpXwYqiT3bxMdPMbu7+ef1G0wt7V3Hr/jQmwPsfjGnylYIWWOb6IAjpQCJJ19GV X-Received: by 2002:a92:b74d:: with SMTP id c13mr65642ilm.176.1628407487044; Sun, 08 Aug 2021 00:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628407487; cv=none; d=google.com; s=arc-20160816; b=zOs5XtKUI6MHdUkjr7KhNdH5sIzIt256t+g2Eqr/YY/xIpag9U+cPcGuOu38UqUAMO Z9dYDAr209hGhZdGz3GmpVbgsYVOXLNO6lYhZjbKnqD0+eWAiQpN+j0yZe5cvi9ts4eV XptD3wDFmpcb49V7ysQ4zi1b3ig5/BadSGFkPhvHH2VNpYX04XKxLXaYsVlPU7Qjwtm9 0BAgyxWovwSsgrLJFRSC6auB8xhYQvPYElS7YjOQS3qZ0VRVTBcf2GKDGgGMuUboIAsO sLJdrTUdsMNo8G8cCfOngvxMYrxfUIjxz55kE0e3ZEKHOle1FuQ+mup4SJRrqa3/0d6B sLwQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W43qUR3sTQpyUJTFrUkdARwm5Xis7ZXGn+3cyo+d/2I=; b=rAgNO8Y6X7io+ng0+fxqiR693OjkjBOB8mtd3kx77uU0Bbb45853cgYLCnrCrCW/rJ DVJp3vy4QXZZAElQcaPsbOgaG1hYtCF4Ccc6XG1NKBfBlOXfBKRVmA7d8IgHdLjbehI7 Pi0tuCOn9tVTQ73uPhzH2XRvL2Xc2wz0pEe0bSodcbBQrDmkfC07vR8h759PJXh8lO2A Yn7dER0f9PZGfAdwoON1JaTb4JqnW7v7arldj9jBieZXWf+FDgYqaM4WuGUuQ0jSb0vZ FaXnXzEYTmZQVNvLA5bFsFaJQ6h1R6XZ8pRtm/HUDhCVFYXtwPeVnqYGrOMVgLsu9p7M psAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dE3Esjov; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si12872171ill.152.2021.08.08.00.24.36; Sun, 08 Aug 2021 00:24:47 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=dE3Esjov; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230515AbhHHHXL (ORCPT + 99 others); Sun, 8 Aug 2021 03:23:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:54720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbhHHHXJ (ORCPT ); Sun, 8 Aug 2021 03:23:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B04860EB5; Sun, 8 Aug 2021 07:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628407370; bh=XtDAjX3F6gbb8u7WB9jFRNSWKJRTjIzxZak8kv4FB5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dE3EsjovAOYSo6ttY2YDRKfHPrZbhhuZxzp/Org21wPdHebP1jGZp0QRyf3wPPJYx oTk52n5sKJITUBuGEpMHGjL27BLslCNpeOBKuzkdAdm9CBEVhJJ2OLN61/iv2jOu7o znTj5LK4+PbHwoIk3TjDJ9ijqw6qm/2m9zY9OwXc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Peter Zijlstra , Darren Hart , Davidlohr Bueso , Bhuvanesh_Surachari@mentor.com, Andy Lowe , Zhen Lei , Joe Korty Subject: [PATCH 4.4 01/11] futex: Rename free_pi_state() to put_pi_state() Date: Sun, 8 Aug 2021 09:22:36 +0200 Message-Id: <20210808072217.370033756@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210808072217.322468704@linuxfoundation.org> References: <20210808072217.322468704@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner [ Upstream commit 29e9ee5d48c35d6cf8afe09bdf03f77125c9ac11 ] free_pi_state() is confusing as it is in fact only freeing/caching the pi state when the last reference is gone. Rename it to put_pi_state() which reflects better what it is doing. Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Darren Hart Cc: Davidlohr Bueso Cc: Bhuvanesh_Surachari@mentor.com Cc: Andy Lowe Link: http://lkml.kernel.org/r/20151219200607.259636467@linutronix.de Signed-off-by: Thomas Gleixner Signed-off-by: Zhen Lei Acked-by: Joe Korty Signed-off-by: Greg Kroah-Hartman --- kernel/futex.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) --- a/kernel/futex.c +++ b/kernel/futex.c @@ -859,9 +859,12 @@ static void pi_state_update_owner(struct } /* + * Drops a reference to the pi_state object and frees or caches it + * when the last reference is gone. + * * Must be called with the hb lock held. */ -static void free_pi_state(struct futex_pi_state *pi_state) +static void put_pi_state(struct futex_pi_state *pi_state) { if (!pi_state) return; @@ -2121,7 +2124,7 @@ retry_private: case 0: break; case -EFAULT: - free_pi_state(pi_state); + put_pi_state(pi_state); pi_state = NULL; double_unlock_hb(hb1, hb2); hb_waiters_dec(hb2); @@ -2139,7 +2142,7 @@ retry_private: * exit to complete. * - EAGAIN: The user space value changed. */ - free_pi_state(pi_state); + put_pi_state(pi_state); pi_state = NULL; double_unlock_hb(hb1, hb2); hb_waiters_dec(hb2); @@ -2214,7 +2217,7 @@ retry_private: } else if (ret) { /* -EDEADLK */ this->pi_state = NULL; - free_pi_state(pi_state); + put_pi_state(pi_state); goto out_unlock; } } @@ -2223,7 +2226,7 @@ retry_private: } out_unlock: - free_pi_state(pi_state); + put_pi_state(pi_state); double_unlock_hb(hb1, hb2); wake_up_q(&wake_q); hb_waiters_dec(hb2); @@ -2376,7 +2379,7 @@ static void unqueue_me_pi(struct futex_q __unqueue_futex(q); BUG_ON(!q->pi_state); - free_pi_state(q->pi_state); + put_pi_state(q->pi_state); q->pi_state = NULL; spin_unlock(q->lock_ptr); @@ -3210,7 +3213,7 @@ static int futex_wait_requeue_pi(u32 __u * Drop the reference to the pi state which * the requeue_pi() code acquired for us. */ - free_pi_state(q.pi_state); + put_pi_state(q.pi_state); spin_unlock(q.lock_ptr); /* * Adjust the return value. It's either -EFAULT or