Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp30390pxa; Tue, 11 Aug 2020 16:20:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNl6PHeHDUgYjDlEG83T5ENmnHF31uHgqieQ/0nTTaM0n4FsnzmU8qiTeMYZEw/ilSuRa0 X-Received: by 2002:a17:906:551:: with SMTP id k17mr27972781eja.322.1597188035689; Tue, 11 Aug 2020 16:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597188035; cv=none; d=google.com; s=arc-20160816; b=MOJ/3LhvsEO36IIomwTYqpRkx4gmUpNwm1R8BBBkhGEeF1z2QsQJRZ56kniG5ivzfQ f9aL7FrZV5c2mszd1TTd7OViOIgomBnEr/85XdO8JVCD/ZW5cTit/MgNkVSgZhihr50z +hoKwy508f9QkWcXaDow/2vLYXFBm7bKiJKwm9Jer+AyNQKoSvf1NQqWiPIn+isTVEM/ tvAe9/PIbm+NzqoeHb1rXLkaKrPDt2M6moqtbgUJ6+LFUcjHS5gJQNa/ELDkYhtzr1LP jGgrAzjvdhw2JMUBXhI33Q1sUpYmWjRCQmJmv06QL149JqfvtRBElv+8JCqLYJPR3U/h kV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=xYoNmNVnRWzyUF6XHQS/r9FWOdLKg2CLHt7lly1DTtA=; b=mbayWMWv5JJWKIpG+ZPYbZN/oRApLMRMjWuhMQ8wUEiNfLHWiguFHWDY8Qot0EkubD hABLPlLEYtXolLmJWFW8EMiBUR9skzz7+gpqeGTFimN9vQP4Ij/ZzNIsnNo0MgD26iK4 sZ0WhDEjkRry0CCRDkhGj2y36ZB5MKkv4ELm4Nv/QJAW/jwY0zT6qTITIZRX4AC7FQX3 eVvth2pj5uxXa3a5yzOUKo9JbTb9kBAb1EBa+fVSZYWeDAULfS66tBMb50od9rsYaKgh XlMuoQ9pvjC/U8SvPcWYqgIe094RSd7mjyQBH/1lV5MwWXs6LLHYmAPJ0e5Y5dCLIT2x v6kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tencent.com header.s=s202002 header.b=deFFdOdn; 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=tencent.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn20si38194ejc.377.2020.08.11.16.19.59; Tue, 11 Aug 2020 16:20:35 -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=@tencent.com header.s=s202002 header.b=deFFdOdn; 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=tencent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726179AbgHKXS0 (ORCPT + 99 others); Tue, 11 Aug 2020 19:18:26 -0400 Received: from mail4.tencent.com ([183.57.53.109]:39215 "EHLO mail4.tencent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgHKXS0 (ORCPT ); Tue, 11 Aug 2020 19:18:26 -0400 Received: from EX-SZ021.tencent.com (unknown [10.28.6.73]) by mail4.tencent.com (Postfix) with ESMTP id 7BC2772530; Wed, 12 Aug 2020 07:18:21 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tencent.com; s=s202002; t=1597187901; bh=ccbasj18elNigywhvKIXQ5fmp3tYk0m6zTnBvcl6CV8=; h=From:To:CC:Subject:Date:References:In-Reply-To; b=deFFdOdnS7w1NEmgc6Ka6XjQUzsgmS2As+bwQ5p4FCTFQMkUz4MYeOWZdYXwQQbBn f2TfEtKJpXVOuMfdo/pV1F/sOnhftYcA252l00EG0nNxi1TekDibOwu+ENZf9OeAZY MIQiiV1Itf3tx2MlnD6YkBg/v9e8/VxDQNo4VZJw= Received: from EX-SZ012.tencent.com (10.28.6.36) by EX-SZ021.tencent.com (10.28.6.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1847.3; Wed, 12 Aug 2020 07:18:21 +0800 Received: from EX-SZ012.tencent.com (10.28.6.36) by EX-SZ012.tencent.com (10.28.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1847.3; Wed, 12 Aug 2020 07:18:21 +0800 Received: from EX-SZ012.tencent.com ([fe80::f57b:8971:e6d4:fe6b]) by EX-SZ012.tencent.com ([fe80::f57b:8971:e6d4:fe6b%3]) with mapi id 15.01.1847.007; Wed, 12 Aug 2020 07:18:21 +0800 From: =?iso-2022-jp?B?YmVuYmppYW5nKBskQj5VSTcbKEIp?= To: Dietmar Eggemann CC: Jiang Biao , "mingo@redhat.com" , Peter Zijlstra , "juri.lelli@redhat.com" , "vincent.guittot@linaro.org" , "rostedt@goodmis.org" , "bsegall@google.com" , "mgorman@suse.de" , LKML Subject: Re: [PATCH] sched/fair: Optimize dequeue_task_fair()(Internet mail) Thread-Topic: [PATCH] sched/fair: Optimize dequeue_task_fair()(Internet mail) Thread-Index: AQHWb7uHIOwUFikfVEWDShzE3PLAcakymr+AgABqtoA= Date: Tue, 11 Aug 2020 23:18:21 +0000 Message-ID: References: <20200811084310.27130-1-benbjiang@tencent.com> <9a2ddb2d-4c9a-a85d-cba2-0956b6d953c0@arm.com> In-Reply-To: <9a2ddb2d-4c9a-a85d-cba2-0956b6d953c0@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [9.19.161.120] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <694C00228257544F84CF6DE302BE3910@tencent.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > On Aug 12, 2020, at 12:55 AM, Dietmar Eggemann = wrote: >=20 > On 11/08/2020 10:43, Jiang Biao wrote: >> Similar optimization as what has been done in commit, >> 7d148be69e3a(sched/fair: Optimize enqueue_task_fair()) >>=20 >> dequeue_task_fair jumps to dequeue_throttle label when cfs_rq_of(se) is >> throttled which means that se can't be NULL. We can move the label after >> the if (!se) statement and remove the if(!se) statment as se is always >> NULL when reaching this point. >>=20 >> Besides, trying to keep the same pattern with enqueue_task_fair can make >> it more readable. >>=20 >> Signed-off-by: Jiang Biao >> --- >> kernel/sched/fair.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >>=20 >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index 04fa8dbcfa4d..cbbeafdfa8b7 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -5618,10 +5618,10 @@ static void dequeue_task_fair(struct rq *rq, str= uct task_struct *p, int flags) >>=20 >> } >>=20 >> -dequeue_throttle: >> - if (!se) >> - sub_nr_running(rq, 1); >> + /* At this point se is NULL and we are at root level*/ >> + sub_nr_running(rq, 1); >>=20 >> +dequeue_throttle: >> /* balance early to pull high priority tasks */ >> if (unlikely(!was_sched_idle && sched_idle_rq(rq))) >> rq->next_balance =3D jiffies; >=20 > There is already a similar patch in master. >=20 > 423d02e1463b - sched/fair: Optimize dequeue_task_fair() (2020-06-25 Peng > Wang) Indeed, my local repo has been outdated, sorry for the interruption. :) Thx. Regards, Jiang