Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp291137rdb; Mon, 29 Jan 2024 02:19:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IF74d3eZkVtI75NP+ItCZt0Q4AqEykyfmdTS/CoJV/rypmyItZXMvroyQTCMlmap9kNoQhf X-Received: by 2002:aa7:d858:0:b0:55f:93e:438d with SMTP id f24-20020aa7d858000000b0055f093e438dmr992834eds.32.1706523597612; Mon, 29 Jan 2024 02:19:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706523597; cv=pass; d=google.com; s=arc-20160816; b=mVeltJriPLQJekoCtgGlDvXhSdwEir5Oq8UD7hnjgCERZ3IKRWi34My0Ys817iJpor w3k5SIdiPn63tZ03m+whoNXualNvHBrmNY8ODjd/cTzWP1HSMFjMtCt8ORZ+GTpAh03P 09B86c1DEKnJEScODVMsCyZeRZF4NW/Z5t2CRBwHLeuEsG3bT+sNKITBohxItrxlno4q f4sZI/Tp2aynKFrA35wYrAu2BnqxWD3KWTNfm04dWk9o7AEqz02ADhbdXsSarRelxbt1 ptPS9q5XskWLx9UDIz80T33PGuxvexBLwwqNgsGj7htW5domUrtLXfhPGWiSzFf18kXe KiHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date; bh=WVXY/3j4JL/pslmHAW1Fvn+SHAY/NPG3QTdfgneqz5M=; fh=f40UFx4PIoN5VHjot5Te0Vsnl2epc2I3Vpkjl2f6MCo=; b=FN0bNrDfeUqEB2Gs0Exc6wLIJEMUVLcu/Hhnovq67G1pkGqdlEeKpk/DpWFMnks/Jj +QG41lNGlAL73m08cmmsHmmG8+J6Cs8d/o6a0XwbZ7sCFnIvTI9L02OgnbVdUXCw2yzy OLmP4fbm5P2qNVICZ2k0Wfau53JPrPUROBUgwtHbtJwZTvEq/xZ12zYnwoKuL89Cq+f0 qWheR0++0/a8ZTXA2UIRdaihpv4jTT7EBHkPkmbjWgsfYDkefMuCUhXSlaxPpuP03p2W t6ZmPrPhsZbI22G0rITXTnA/u8f0iFGUgBOlqFTk9LFO6HWsZwJ8cD/IJuzGw5f/tfn/ bsxA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=xfusion.com); spf=pass (google.com: domain of linux-kernel+bounces-42527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42527-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l6-20020aa7c3c6000000b0055c72de0fddsi3410902edr.91.2024.01.29.02.19.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 02:19:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=xfusion.com); spf=pass (google.com: domain of linux-kernel+bounces-42527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42527-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6115A1F22BCE for ; Mon, 29 Jan 2024 10:19:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7DEE57335; Mon, 29 Jan 2024 10:19:36 +0000 (UTC) Received: from wxsgout04.xfusion.com (wxsgout03.xfusion.com [36.139.52.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07BB856474 for ; Mon, 29 Jan 2024 10:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=36.139.52.80 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706523576; cv=none; b=b2A4vpFCIZnHSIM1W5tyJXmNbMCR79QxqBhqjQpVLGgkRo8m0DlUAg9xANwdz7NT4VM1iZTb1sTgI5WyER4ZqwadoDkmimOcaFOrDejB6Ek0ZvD+TXARtdyCgr13GlrRSLk29mfhOVY/AA6Co3CgOghw/J6dyhhKWW1otxzA5HQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706523576; c=relaxed/simple; bh=0pbNMZwQGIU61mp3Riq86bwoqCEQr3qg2nODWQqlvcU=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=GfhP1Kb/yqjzdDJ7Xjht7CoRJD009MG+VdiDA52R8kkvf+nO1Fcru1WEbe0ZRTQfCDpijYYkroDTWe5rbEGwZ/xXwDjYSDpfq6wbUgtwdkcg9yl6aYRMzGf2fNSKKQzoeLpkUzZjG1ZyACGxrAR9UMuNRSZ2oamRVqIpjfqYV/A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xfusion.com; spf=pass smtp.mailfrom=xfusion.com; arc=none smtp.client-ip=36.139.52.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xfusion.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xfusion.com Received: from wuxshcsitd00600.xfusion.com (unknown [10.32.133.213]) by wxsgout04.xfusion.com (SkyGuard) with ESMTPS id 4TNkmW1wQgzB0Y9C; Mon, 29 Jan 2024 18:19:07 +0800 (CST) Received: from localhost (10.82.147.3) by wuxshcsitd00600.xfusion.com (10.32.133.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 29 Jan 2024 18:19:30 +0800 Date: Mon, 29 Jan 2024 18:19:29 +0800 From: Wang Jinchao To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , CC: , Subject: [PATCH] sched/core: Fix prio for fair in __task_prio Message-ID: <202401291819+0800-wangjinchao@xfusion.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-ClientProxiedBy: wuxshcsitd00600.xfusion.com (10.32.133.213) To wuxshcsitd00600.xfusion.com (10.32.133.213) It is said "120" in the comment, but MAX_RT_PRIO + MAX_NICE equals 119. DEFAULT_PRIO should be the right prio. Fix it and imodify the corresponding prio in prio_less. Signed-off-by: Wang Jinchao --- kernel/sched/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9116bcc90346..13484ee71e5b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -168,7 +168,7 @@ static inline int __task_prio(const struct task_struct *p) if (p->sched_class == &idle_sched_class) return MAX_RT_PRIO + NICE_WIDTH; /* 140 */ - return MAX_RT_PRIO + MAX_NICE; /* 120, squash fair */ + return DEFAULT_PRIO; /* 120, squash fair */ } /* @@ -194,7 +194,7 @@ static inline bool prio_less(const struct task_struct *a, if (pa == -1) /* dl_prio() doesn't work because of stop_class above */ return !dl_time_before(a->dl.deadline, b->dl.deadline); - if (pa == MAX_RT_PRIO + MAX_NICE) /* fair */ + if (pa == DEFAULT_PRIO) /* fair */ return cfs_prio_less(a, b, in_fi); return false; -- 2.40.0