From patchwork Thu Jul 13 06:18:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 107547 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1810370qge; Wed, 12 Jul 2017 23:19:35 -0700 (PDT) X-Received: by 10.84.133.38 with SMTP id 35mr8283791plf.141.1499926775130; Wed, 12 Jul 2017 23:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499926775; cv=none; d=google.com; s=arc-20160816; b=ZIwwHVX6mJolyfVBd10djSZII2lI6ZG2seodTkM6J2KAoQnpiCPeneQtibILDZmgnn pqLe4TluTYMXawmXBhDm0tomYQZPF8a0HlK9fKTuAsuV3zxMgkyZgxjWZsOCPDaskqiW 4Djyr81Dsdc0jLS4BBY1Fv+0ad2MvCmzycjqQHoXdqR2jxSb/yq4M78/Csb3h4ClygBt 3YQvRyrNIgUb5TjshjOFILMvxnWQPWAOIfankkj4+5VscmWxBwvaPEx3Zusgix/6v6ta ymegQbBGuaXzdg7qMbLqAfsugP0YZUz11KeLcJB6PXeHk9NNzQ+Ac+8Baon9hXlr68IG /hcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=BTZDVOjbM0fLWydIYgGh571snZcWNG6kfpoLgouWSOw=; b=frK3lC1Dxv0reMbjd/7ywW8EnLtK7ZZZEbPE9SPpGeEsF/Btm/NTHkwk/0Fu4JRd9A H+1FP+KorGDkfCxp6rdUij8ostg9S2cN+vGr9DpJ4NcAlWxRAr8TcDowoaN5TLsaW+2s MP21YmnacZbS7laHjj5MUrFLZMcLBorNTJuKRiTggibigoSfd2IBoX7765v+HLQipvtN F5pyPXbEeKjTR0GSzfg3HOdJxt15EatF+pspPylqLgOTMrp2cX9n31GEvm8bO16pG4tc UzhVSs70bQ4vF2459gsuF7tGHdEOrxCrg6C4jZXWTRfE/5JifYvbzRSbNG8mGbhfgj9w OTZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=bV4/F8uQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si3555062pfa.98.2017.07.12.23.19.34; Wed, 12 Jul 2017 23:19:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=bV4/F8uQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751157AbdGMGTW (ORCPT + 25 others); Thu, 13 Jul 2017 02:19:22 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:33175 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbdGMGTV (ORCPT ); Thu, 13 Jul 2017 02:19:21 -0400 Received: by mail-pg0-f54.google.com with SMTP id k14so24651306pgr.0 for ; Wed, 12 Jul 2017 23:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=BTZDVOjbM0fLWydIYgGh571snZcWNG6kfpoLgouWSOw=; b=bV4/F8uQberf7+mjLK3HgP0SKK6nIhidwjzJNfzywzRGfNdkbphD2v70mGSVvyBHyl H0y95NtiKCmQd0zXU9ABfzm4fPl0/4XPR5O6IZbzRCQD5GtP+JP/XbO/EhxfeL0clCd6 ILA82t37O1I5M+nH2YeCi7JJHd1P+Lzm0vWjo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BTZDVOjbM0fLWydIYgGh571snZcWNG6kfpoLgouWSOw=; b=H/3OxkcBbnJGJptcYJMfrUjaBwOPr6OgXqLhll5cirmHmFu0OraaTT1uuZXdHe+pgh 9jH19LrZ6a7d0vYFpEv3fAksuTPoFq4Nhp460Z7jyU5DiB5LNn2Ra39U9RSoNTMdcWXm 0O6uMS4uOwt4DFT1bjA9u0YBBiZSuDblXJhH0LH4Lp6stnV+ocmBDBJvN9nI0kusMWcJ HQ7n9R4Tu0k/97VHmmADtnT9R1OsRk0htmi5qJPxGCeIW7DxBRgN/3G1l3xstsyeFqjZ 3bH1jCCnPFsHvdMMtXn+HJ9ey/yA1sMNuV7JPR3xTCbrvb8xMz7ajxLlLTiWOa8anGZM eP+w== X-Gm-Message-State: AIVw110VG8jOjOvgUOEU5VN5pWEZ17F0esEmfp+IK2tZwXZt67MMUVQE q1gv/KOH2oUHpKgV X-Received: by 10.84.224.207 with SMTP id k15mr8220804pln.15.1499926760762; Wed, 12 Jul 2017 23:19:20 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.191]) by smtp.gmail.com with ESMTPSA id g7sm8986458pfj.29.2017.07.12.23.19.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 23:19:20 -0700 (PDT) From: Alex Shi To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org (open list:LOCKING PRIMITIVES) Cc: linux-kernel@vger.kernel.org, Alex Shi , Steven Rostedt , Sebastian Siewior , Mathieu Poirier , Juri Lelli , Thomas Gleixner Subject: [PATCH] rtmutex: remove unnecessary adjust prio Date: Thu, 13 Jul 2017 14:18:24 +0800 Message-Id: <1499926704-28841-1-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We don't need to adjust prio before new pi_waiter adding. The prio only need update after pi_waiter change or task priority change. Steven Rostedt pointed: "Interesting, I did some git mining and this was added with the original entry of the rtmutex.c (23f78d4a0). Looking at even that version, I don't see the purpose of adjusting the task prio here. It is done before anything changes in the task." Signed-off-by: Alex Shi Cc: Steven Rostedt Cc: Sebastian Siewior Cc: Mathieu Poirier Cc: Juri Lelli Cc: Thomas Gleixner To: linux-kernel@vger.kernel.org To: Ingo Molnar To: Peter Zijlstra Reviewed-by: Steven Rostedt (VMware) --- kernel/locking/rtmutex.c | 1 - 1 file changed, 1 deletion(-) -- 2.7.4 diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 28cd09e..d1fe41f 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -963,7 +963,6 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, return -EDEADLK; raw_spin_lock(&task->pi_lock); - rt_mutex_adjust_prio(task); waiter->task = task; waiter->lock = lock; waiter->prio = task->prio;