From patchwork Tue Dec 19 12:43:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Jinchao X-Patchwork-Id: 180909 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1907875dyi; Tue, 19 Dec 2023 04:44:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhfE+U6lHsW9N/VbImIg/qOWUKunCopX1bkM3GAyw3Y2DHEqmpWF30IHV1S860VncxPqUr X-Received: by 2002:a05:6808:ec7:b0:3b8:b063:825f with SMTP id q7-20020a0568080ec700b003b8b063825fmr20384004oiv.97.1702989858578; Tue, 19 Dec 2023 04:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702989858; cv=none; d=google.com; s=arc-20160816; b=C4X/98QA/Kk/9EDZ9p/V5PBxeP0lEoPficvWs3Iq43amb9z306A0BaXHJ2mUlWCfPO /YA2th/tgQVpWWJEKfp8Vsa+qQmfmhAYWtjAYY3gu12rbWOMsD17ynAeY53dj4lVrsu8 QKmj3dhyAPD7WB+23/HZDGXK4yfNwOBtPqtGf9QqKP6cqDgV1UGSNxuS7YmFXwU6o542 5Xa2wvMOpLvK6Xx9j9YTh8PaSosgiFNbcPmgCN1KFaFbuDx5DVZ1ywEq7Q1mzLhJVWni c4qn9Fc+VIgBXJxB2pjMzLgYRpnER0/9Bm7jBUiDCPPU1WWC1m1WAFlA1iIAaKN4AcJl Bb1g== ARC-Message-Signature: i=1; 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=3FajsNPBhnzbxd1VPYgmlMWeuhH28e2FpLwIbPR8Vjc=; fh=f40UFx4PIoN5VHjot5Te0Vsnl2epc2I3Vpkjl2f6MCo=; b=kBZZOMr+pXLfDzlyGp46udn41fkDlf+fGeOb7JjJnKHLkwZRQF/urJOoM1CNqOh1qo iBDrJbk8R8aEYq+4Ha+tv98zdDFXs8amxjL/hxIVD44V2+kJx1S9wqr2Gry+C740vJ4P sWGSCEjfm/fcekv2PhaAIZKZBcc04arJmBmwf93dfRh0/BJVZdQTZtZdPjJg37vpt/Xm 5p7+EniCNx6MFfT3Tu+XZg4hJR8umdh7RnQh3r0XMNrLVKRsZVsvaRqJNrUgogSeP2kc wTd2QNUDBLx/Ge6PkmL8R7YdadFTZB3/MMvtN1EtayshLCyvuHmVHcbq+9+VdgIzb0zX WZ4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5184-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5184-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x16-20020ae9f810000000b0077fad1ee0fasi10499961qkh.373.2023.12.19.04.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 04:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5184-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5184-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5184-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5EEF81C23DAB for ; Tue, 19 Dec 2023 12:44:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE7921B29E; Tue, 19 Dec 2023 12:44:02 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 8552D1B26C for ; Tue, 19 Dec 2023 12:43:59 +0000 (UTC) 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 4SvbrW1NwFzB0K9t; Tue, 19 Dec 2023 20:40:27 +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; Tue, 19 Dec 2023 20:43:54 +0800 Date: Tue, 19 Dec 2023 20:43:53 +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/fair: Correct comment for enqueue_task_fair Message-ID: <202312192042+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-Disposition: inline X-ClientProxiedBy: wuxshcsitd00601.xfusion.com (10.32.135.241) To wuxshcsitd00600.xfusion.com (10.32.133.213) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785714294156740515 X-GMAIL-MSGID: 1785714294156740515 There is `add_nr_running(rq, 1);` in `enqueue_task_fair`, so the original comment is confusing, correct it. Signed-off-by: Wang Jinchao --- kernel/sched/fair.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d7a3c63a2171..0230f4594dfc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6652,9 +6652,8 @@ static int sched_idle_cpu(int cpu) #endif /* - * The enqueue_task method is called before nr_running is - * increased. Here we update the fair scheduling stats and - * then put the task into the rbtree: + * The enqueue_task method is called to update the fair scheduling stats + * and put the task into the rbtree, and increase nr_running. */ static void enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)