Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6084786rwl; Wed, 22 Mar 2023 06:24:20 -0700 (PDT) X-Google-Smtp-Source: AK7set+TOoBzd/rjngRsRaZTGKzWHowdpxBgj4146IDYL8YHwjQ6/HOqah2gkjmRDrvZceC6tRPU X-Received: by 2002:a17:906:31d8:b0:92f:8353:2aaf with SMTP id f24-20020a17090631d800b0092f83532aafmr6755060ejf.70.1679491460055; Wed, 22 Mar 2023 06:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679491460; cv=none; d=google.com; s=arc-20160816; b=u/ynrhysdft42osRNn958D7+3YAIg3Ix0NL5UYCLOYIfXtP/PU/uhHgYgXlR5rsOhU KFZS1y0bZtxIv4tecZP4jpaQcPzbrf49BQkAjGYctHEN+mxoREb9l37MCvpbgXqiRjS1 T5gcG0RrNQpjZwLbZ9JfhD60HbKo09CxOK256Tp76O6li78oXICc0Vgiu42eiI+tFkzd YAXfF5mx8wVFH5p8/FciudupqbKxRkUcEZkbFtmozkbbL2rPMOlz45HCKzUqhFA8Xegf J4HxK0oL6L+Eq82wS8diMbY/n8QbZ3nCrUUwOInrqaPDDsyLjFpB5dfwzJtNlPi4FoRQ zhYA== 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; bh=OCkjskKEbQ24arQvxisQAx+V9181a0t5lf3SCNY9F9o=; b=mSC7yGTrIQ5FsPNRdiWxWCKIYqovyf2GWPy2n/JwNeKLrLJaA/YxSjUdO7f1gJTJhD WmxWzdJsVdbCFS2ti5H85kA+DoOLirTZ6+1d4VkNbr9sbXMy/mKs3jHdiRmiHh9/JJnq PWmP/T4quygxS8W5vDL3/efuySvbW4ZoBAyZCxr7n5Lg1An3L080FQ01ciO40IQOP1lT DKjlRohuzm1oA8NJvlGfz2HZe4bf9H7mqKrN0jlffkGCaeTyPmGxCh12RFQh6vKLxjQt GeNh6z5huQW/0MSEXxZ2xud3Pn8a0G30MILw2LNF7KziiSxIT2x0XI612BxbBPqi7Fvp J2tA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r9-20020aa7d149000000b004acbeceab83si16706437edo.448.2023.03.22.06.23.55; Wed, 22 Mar 2023 06:24:20 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230479AbjCVNTX (ORCPT + 99 others); Wed, 22 Mar 2023 09:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbjCVNTJ (ORCPT ); Wed, 22 Mar 2023 09:19:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FC1127497; Wed, 22 Mar 2023 06:19:00 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E6F5A4B3; Wed, 22 Mar 2023 06:19:43 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 65D3E3F6C4; Wed, 22 Mar 2023 06:18:56 -0700 (PDT) Message-ID: Date: Wed, 22 Mar 2023 14:18:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [RFC PATCH 2/3] sched/cpuset: Keep track of SCHED_DEADLINE tasks in cpusets Content-Language: en-US To: Juri Lelli , Waiman Long Cc: Peter Zijlstra , Ingo Molnar , Qais Yousef , Tejun Heo , Zefan Li , Johannes Weiner , Hao Luo , 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: <20230315121812.206079-1-juri.lelli@redhat.com> <20230315121812.206079-3-juri.lelli@redhat.com> <7a3b31bf-4f6a-6525-9c6a-2bae44d7b0af@redhat.com> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 15/03/2023 18:14, Juri Lelli wrote: > On 15/03/23 11:46, Waiman Long wrote: >> >> On 3/15/23 08:18, Juri Lelli wrote: [...] >>> @@ -2472,6 +2492,11 @@ static int cpuset_can_attach(struct cgroup_taskset *tset) >>> ret = security_task_setscheduler(task); >>> if (ret) >>> goto out_unlock; >>> + >>> + if (dl_task(task)) { >>> + cs->nr_deadline_tasks++; >>> + cpuset_attach_old_cs->nr_deadline_tasks--; >>> + } >>> } >> >> Any one of the tasks in the cpuset can cause the test to fail and abort the >> attachment. I would suggest that you keep a deadline task transfer count in >> the loop and then update cs and cpouset_attach_old_cs only after all the >> tasks have been iterated successfully. > > Right, Dietmar I think commented pointing out something along these > lines. Think though we already have this problem with current > task_can_attach -> dl_cpu_busy which reserves bandwidth for each tasks > in the destination cs. Will need to look into that. Do you know which > sort of operation would move multiple tasks at once? Moving the process instead of the individual tasks makes cpuset_can_attach() have to deal with multiple tasks. # ps2 | grep DLN 1614 1615 140 0 - DLN thread0-0 1614 1616 140 0 - DLN thread0-1 1614 1617 140 0 - DLN thread0-2 # echo 1614 > /sys/fs/cgroup/cpuset/cs2/cgroup.procs