Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2611997pxb; Tue, 24 Aug 2021 03:29:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx8wnlo4S6JkoN2A/iKuswM+Sd23h1W/2ITXq3dRT6ZScLvISKTondIZrSeSZTjw33OEYX X-Received: by 2002:aa7:d818:: with SMTP id v24mr42169583edq.170.1629800987505; Tue, 24 Aug 2021 03:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629800987; cv=none; d=google.com; s=arc-20160816; b=QnOjXzChDw7xDBlXt7JqPNrInu7KEo1UVjqoGKSB7UEwH7bMzjU1Fnh9BODGNVBJnR LhGWSbe9Bi6OGDUflmPgw8NS0UCB6b2iKfoComzM5UxTMSFhJCC/hPHfJ+eFezzPE/0e /dDJmWNwzY2MAReSfQD1BH682xkNPZd35fvEUROtHgsw+NSmp567k5VBmXxEtQajrnO+ 6v5woG59FFQOfCg2rMf+S6taCc33VnPcDQRkjTnN7fSf933XyIUFM1cGXklnH9xSmdKy ez8dujqAZ1idyLEupKnVmWfbQ1Wk60cxSROuAzVW43gJWwpnh4iG5iPqWmfBOlJVw5/p kaZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=5YEqAeMQR4fquarz/Z5R1nj14VRgRj0vAp2aycsCIgY=; b=dCmimCtAvlB+gXKZImo7jQTXrENOI7H1TkP1FpHjbZm83q6EhNnm+79Z5RtsiRHQlm aJYY6dyB0ZaUlRUcXmLyzChaIFyeqo6ED7H4thlS0S6feJogiARxzBVVzfzuUj435aTG iOc8xv1KFXLgwbQJg03U849czEcofs95R4M/AU1J6+jwj1zuBIFZtT0mEfGCZTKjTV2I uoTo6UlD4XWoI50LeWSDS+tVfCuJA4KMY9KBqZ0XIhdUev5DycsFrCpt04MG94wnQiYz iKsBODKCr2tNxUjfRg+Q27+MLjQMv0ZcYvAlGZD+Lhi4y6h8t1B2c6xWd1y+QkIQb5q0 d6lg== 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 j12si6014944edr.598.2021.08.24.03.29.23; Tue, 24 Aug 2021 03:29: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; 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 S235971AbhHXK0r (ORCPT + 99 others); Tue, 24 Aug 2021 06:26:47 -0400 Received: from mx425.baidu.com ([119.249.100.233]:3906 "EHLO mx425.baidu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235905AbhHXK0r (ORCPT ); Tue, 24 Aug 2021 06:26:47 -0400 X-Greylist: delayed 395 seconds by postgrey-1.27 at vger.kernel.org; Tue, 24 Aug 2021 06:26:46 EDT Received: from bjhw-sys-rpm015653cc5.bjhw.baidu.com (bjhw-sys-rpm015653cc5.bjhw.baidu.com [10.227.53.39]) by mx425.baidu.com (Postfix) with ESMTP id 277D1125833B6; Tue, 24 Aug 2021 18:19:16 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by bjhw-sys-rpm015653cc5.bjhw.baidu.com (Postfix) with ESMTP id 1BC0CD9932; Tue, 24 Aug 2021 18:19:16 +0800 (CST) From: Li RongQing To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, lirongqing@baidu.com Subject: [PATCH] sched/core: return prio_less() directly in __sched_core_less Date: Tue, 24 Aug 2021 18:19:16 +0800 Message-Id: <1629800356-45550-1-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org return prio_less() directly to avoid unnecessary checking Signed-off-by: Li RongQing --- kernel/sched/core.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2d9ff40..73478c9 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -140,10 +140,7 @@ static inline bool __sched_core_less(struct task_struct *a, struct task_struct * return false; /* flip prio, so high prio is leftmost */ - if (prio_less(b, a, task_rq(a)->core->core_forceidle)) - return true; - - return false; + return prio_less(b, a, task_rq(a)->core->core_forceidle); } #define __node_2_sc(node) rb_entry((node), struct task_struct, core_node) -- 1.7.1