Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1173253rwr; Wed, 3 May 2023 11:04:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7M8p8q+q5m3e8LOFEv6A1kiy93nQFeRLj13xrW6Ii23x8FSsH8WE5CYZPFN1rTtt93RxOa X-Received: by 2002:a05:6a20:7491:b0:f2:9378:814a with SMTP id p17-20020a056a20749100b000f29378814amr30067179pzd.49.1683137088165; Wed, 03 May 2023 11:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683137088; cv=none; d=google.com; s=arc-20160816; b=jJUGMqd4iOwqiv4WYomC69PJQEBQ3WguQd5UzvzvM0pfDQMWktoZXLuDoIqldT0o3z pkzdq3gJv35EMRMSwIL2KLs0b55TxQ6LcLisFvPsFroScAwPOijUSWh8ATRA8Flskeej ScHaSirfANQU3PGT+WQkCGZtTArGXEyFqEDOEBXvoSTDAxsaiw4GocwMg+L9Jd4qoOfX 7jkSvdxH9X02hnGOx3c0Xp4JGNPO7NVnfnDRfW2MxQr7/vFW3T2RoHrDrRRyF3QJUfuB p6n+VCzE13KRwciYowuQkCBaj24F3YjiRtzkHF9ZBUmg2zQippKQmHZrXtmhsDpoHf+P rtUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=bsL+UOJbF/TNc0P0DpLZQCkCHaeoLKCd8i3Rcq5uipg=; b=q1OFlyWJG4roYOTy0ek4u5jzf7JQZYp58lbPWutCPEKy9AY5bEkHWwbKGgY8bmwLNZ 8sYW+ofLTgwamWn4i/CMLsWShyV1uNpdaCfQG6WptVFM/60jtAT1nsqbSXyJnREL4Qwr xgs/B5HY2V+ZoD9NPYK/zDdd7E2KrVCM/FMqK1fWEoKEhTLA5KI+0NMR/X8ofDKGOJE2 0Pw33gNoOGQf61gdxVPwrv38yj9zZmxUShrM4O75CzSrTcV50PZimWPiAeCUDzSaoLo8 tHLd+jNXI8KJbZUTreeZzr7K1DkemXEgzwDF+Uie3e1rRr6fq3s8qdLUXhIZpJ64gWR2 Gr3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QpVwxy1Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k29-20020a63ff1d000000b0051f04512a26si32784805pgi.393.2023.05.03.11.04.35; Wed, 03 May 2023 11:04:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QpVwxy1Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbjECR52 (ORCPT + 99 others); Wed, 3 May 2023 13:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjECR51 (ORCPT ); Wed, 3 May 2023 13:57:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7F3E4C13 for ; Wed, 3 May 2023 10:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683136602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bsL+UOJbF/TNc0P0DpLZQCkCHaeoLKCd8i3Rcq5uipg=; b=QpVwxy1QUX5DIvVIHs/QPD40lbGgR7KVyU5FUk1hCwwKagLgYtKUi+AdZmMb33s2dG7BBF +QRTQK5BvcRv2m4AUtJTETlYkvAxgOzQ+zsSCjSfcc5kDgHzmTeNfFz2AIDjo3BMy4eb6y zV24isyrmxmylGHlRCEXS1TUvywaXfY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-279-WCcH1OIFMTyPQJExjOqJfw-1; Wed, 03 May 2023 13:56:36 -0400 X-MC-Unique: WCcH1OIFMTyPQJExjOqJfw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 891D8185A79C; Wed, 3 May 2023 17:56:35 +0000 (UTC) Received: from [10.22.17.228] (unknown [10.22.17.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF33C492C13; Wed, 3 May 2023 17:56:34 +0000 (UTC) Message-ID: <86854aad-d649-9369-c53d-75446ab8de7b@redhat.com> Date: Wed, 3 May 2023 13:56:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v2 4/6] cgroup/cpuset: Iterate only if DEADLINE tasks are present Content-Language: en-US To: Juri Lelli , Peter Zijlstra , Ingo Molnar , Qais Yousef , Tejun Heo , Zefan Li , Johannes Weiner , Hao Luo Cc: Dietmar Eggemann , Steven Rostedt , linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, mathieu.poirier@linaro.org, cgroups@vger.kernel.org, Vincent Guittot , Wei Wang , Rick Yiu , Quentin Perret , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sudeep Holla References: <20230503072228.115707-1-juri.lelli@redhat.com> <20230503072228.115707-5-juri.lelli@redhat.com> From: Waiman Long In-Reply-To: <20230503072228.115707-5-juri.lelli@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/3/23 03:22, Juri Lelli wrote: > update_tasks_root_domain currently iterates over all tasks even if no > DEADLINE task is present on the cpuset/root domain for which bandwidth > accounting is being rebuilt. This has been reported to introduce 10+ ms > delays on suspend-resume operations. > > Skip the costly iteration for cpusets that don't contain DEADLINE tasks. > > Reported-by: Qais Yousef > Link: https://lore.kernel.org/lkml/20230206221428.2125324-1-qyousef@layalina.io/ > Signed-off-by: Juri Lelli > --- > kernel/cgroup/cpuset.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index b9f4d5602517..6587df42cb61 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -1090,6 +1090,9 @@ static void dl_update_tasks_root_domain(struct cpuset *cs) > struct css_task_iter it; > struct task_struct *task; > > + if (cs->nr_deadline_tasks == 0) > + return; > + > css_task_iter_start(&cs->css, 0, &it); > > while ((task = css_task_iter_next(&it))) Reviewed-by: Waiman Long