Message ID | 20230503072228.115707-1-juri.lelli@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1142230vqo; Wed, 3 May 2023 00:39:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+BZOvS8ThG8cu9cL5h5BI314lnidu+h+gIuF9gOCZu7Zvgioliv1gzoecPjhQLhfetk3n X-Received: by 2002:a17:902:db11:b0:1a6:4016:8974 with SMTP id m17-20020a170902db1100b001a640168974mr1576700plx.31.1683099567217; Wed, 03 May 2023 00:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099567; cv=none; d=google.com; s=arc-20160816; b=M5H93+D3s7i8sviSL/kMHjb/Hk6qMCX5LSCcG3IzKMGdj168/JM0F9V9zoPIvynR3q cv/VbPufdA6glP02mjPJNP5LWO6kioNHrTMnBABGWaGNXXbceEkMj1sqPgv0E8HnUTqC rDAN33apafIbNnGFfJ0/mpbJn8mcHK0MtrBcP5uCDFe4Z7JscOlZtDNxia/j2x/RtW9C fTRRZOoehPqDVrBqW1TwzmxtL76kFN6R/irGwrU/Tb39MRCuo7rrtDxIwjoLGc0HaDdr 8HDWBCvD8mV1v3odcdk0zoElHBeKbjG2+G3wSLic2uXoEvVspxAPPs2RMrs2ou7jj7cY CPaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IIZ/GCCJmx19uZ3mIOzJAELhL8g2Ju+C9RZzvBPp+14=; b=k92nNZ1Wn6t0d98L83byvouinyIek1VAONX8p7vQk6DHza1ACAHXm0k3jx0l/7HtKB ieUqx+cXyMnGeJ7Z9XMvOLTGanFAG22GmM709HBLPSj3tdwTddfp35dj2xWqKtCcNVwT Ga+/WFKeKxCYFB2F7rpjEq8+o7bHTUJw5xV8+OYhPhW90wYjRadlYfLVU1h1oPqDtA0P /YgGnUNCHLK7qzhsgQE5DDWEWOZhV7HhsXQQTJjtDqlJt14fvUwFu9a4z/8c4KiYO6mS ElAx22iB6h/EyYSJ2FJmKyVkbhr141+tvKffZzMG0wL/bAL+Iz+pE2yBrxJqJyNm36hl qDvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UlD8BqzR; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a170902d50700b001a66bec3ceesi36130522plg.256.2023.05.03.00.39.12; Wed, 03 May 2023 00:39:27 -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=UlD8BqzR; 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 S229636AbjECHXm (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Wed, 3 May 2023 03:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjECHXl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 3 May 2023 03:23:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3992D6B for <linux-kernel@vger.kernel.org>; Wed, 3 May 2023 00:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683098576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=IIZ/GCCJmx19uZ3mIOzJAELhL8g2Ju+C9RZzvBPp+14=; b=UlD8BqzR8DFk0puuZ5Ptlirl9D9/L/DVHBLKqcTnNFKDtMFfm0OEWH4T5GtMUCkvRBzQHh /S6TYuDVcPFEeU8nVxq5NL5ndbqUaZLq1x17aP/CyoAxuBgc6BGT0/wxl/pyPwTIxs/BK0 TZ5JqXCGle5be3/PRNlx5cJe0CQXp9Y= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-kBKUc3_rMOO_0ymzOPYMOw-1; Wed, 03 May 2023 03:22:55 -0400 X-MC-Unique: kBKUc3_rMOO_0ymzOPYMOw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3062e5d0cd3so1102380f8f.3 for <linux-kernel@vger.kernel.org>; Wed, 03 May 2023 00:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683098574; x=1685690574; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IIZ/GCCJmx19uZ3mIOzJAELhL8g2Ju+C9RZzvBPp+14=; b=KWCXdMgs4eCO6i72oclIYNLkavRJTjFb1RrnFhMSAIzhO/UBdgg/xc2ZgdXRdnFW+y VFuWdlY8YxTyzguGo60SiP5cFA1qn+zxx2zHiM3XYet15mmGhQ0ksbXqf344O7cFyyVz g68KX2MTPJAxYPi+a9Y7/ZsZpYfsglwviKLoIsBd2yx8XDgWXlkRJQZMJBJzRNFzRpZx pDHAh9nDVYnDt2w79BYg2EmTXF9/tnqzHxiNyOaotQ2cJVf5XIlVhX31viEcsgfmJXEU QYSYYlb1iLeT87t4JjV3FjBhfQ9YGigx1mWVmYf7w8YQEnuwJNchdhGiyM47XOOlY2yW jFeA== X-Gm-Message-State: AC+VfDw5UUZ7Ad9poU9fUAnF4OFZ9JMyby3QpkNt78qfI+H9Wi5m99iy 51YpM+xmIxHixy8tqftVpiCppkZDW77auWxPATuCc/lcW3Qa3Pko8FPcOe8uKrh0/ZWeVEmVXMa hqJu2MRrtWsVHvMhGRqlceReK X-Received: by 2002:a05:6000:1191:b0:306:34f6:de8a with SMTP id g17-20020a056000119100b0030634f6de8amr3740011wrx.71.1683098573814; Wed, 03 May 2023 00:22:53 -0700 (PDT) X-Received: by 2002:a05:6000:1191:b0:306:34f6:de8a with SMTP id g17-20020a056000119100b0030634f6de8amr3739998wrx.71.1683098573403; Wed, 03 May 2023 00:22:53 -0700 (PDT) Received: from localhost.localdomain.com ([2a02:b127:8011:7489:32ac:78e2:be8c:a5fb]) by smtp.gmail.com with ESMTPSA id k1-20020a7bc301000000b003eddc6aa5fasm947259wmj.39.2023.05.03.00.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:22:52 -0700 (PDT) From: Juri Lelli <juri.lelli@redhat.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>, Qais Yousef <qyousef@layalina.io>, Waiman Long <longman@redhat.com>, Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>, Johannes Weiner <hannes@cmpxchg.org>, Hao Luo <haoluo@google.com> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>, Steven Rostedt <rostedt@goodmis.org>, 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 <vincent.guittot@linaro.org>, Wei Wang <wvw@google.com>, Rick Yiu <rickyiu@google.com>, Quentin Perret <qperret@google.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, Sudeep Holla <sudeep.holla@arm.com>, Juri Lelli <juri.lelli@redhat.com> Subject: [PATCH v2 0/6] sched/deadline: cpuset: Rework DEADLINE bandwidth restoration Date: Wed, 3 May 2023 09:22:22 +0200 Message-Id: <20230503072228.115707-1-juri.lelli@redhat.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764857811863970605?= X-GMAIL-MSGID: =?utf-8?q?1764857811863970605?= |
Series |
sched/deadline: cpuset: Rework DEADLINE bandwidth restoration
|
|
Message
Juri Lelli
May 3, 2023, 7:22 a.m. UTC
Qais reported [1] that iterating over all tasks when rebuilding root domains for finding out which ones are DEADLINE and need their bandwidth correctly restored on such root domains can be a costly operation (10+ ms delays on suspend-resume). He proposed we skip rebuilding root domains for certain operations, but that approach seemed arch specific and possibly prone to errors, as paths that ultimately trigger a rebuild might be quite convoluted (thanks Qais for spending time on this!). This is v2 of an alternative approach (v1 at [3]) to fix the problem. 01/06 - Rename functions deadline with DEADLINE accounting (cleanup suggested by Qais) - no functional change 02/06 - Bring back cpuset_mutex (so that we have write access to cpusets from scheduler operations - and we also fix some problems associated to percpu_cpuset_rwsem) 03/06 - Keep track of the number of DEADLINE tasks belonging to each cpuset 04/06 - Use this information to only perform the costly iteration if DEADLINE tasks are actually present in the cpuset for which a corresponding root domain is being rebuilt 05/06 - Create DL BW alloc, free & check overflow interface for bulk bandwidth allocation/removal - no functional change 06/06 - Fix bandwidth allocation handling for cgroup operation involving multiple tasks With respect to the v1 posting [3] 1 - rebase on top of Linus' tree as of today (865fdb08197e) 2 - move patch 6 to position 4 - Qais As the rebase needed some work, I decided to remove the tested and reviewed bys. Please take another look, just in case I messed something up. This set is also available from https://github.com/jlelli/linux.git deadline/rework-cpusets Best, Juri 1 - https://lore.kernel.org/lkml/20230206221428.2125324-1-qyousef@layalina.io/ 2 - RFC https://lore.kernel.org/lkml/20230315121812.206079-1-juri.lelli@redhat.com/ 3 - v1 https://lore.kernel.org/lkml/20230329125558.255239-1-juri.lelli@redhat.com/ Dietmar Eggemann (2): sched/deadline: Create DL BW alloc, free & check overflow interface cgroup/cpuset: Free DL BW in case can_attach() fails Juri Lelli (4): cgroup/cpuset: Rename functions dealing with DEADLINE accounting sched/cpuset: Bring back cpuset_mutex sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets cgroup/cpuset: Iterate only if DEADLINE tasks are present include/linux/cpuset.h | 12 +- include/linux/sched.h | 4 +- kernel/cgroup/cgroup.c | 4 + kernel/cgroup/cpuset.c | 242 ++++++++++++++++++++++++++-------------- kernel/sched/core.c | 41 +++---- kernel/sched/deadline.c | 67 ++++++++--- kernel/sched/sched.h | 2 +- 7 files changed, 244 insertions(+), 128 deletions(-)
Comments
On Wed, May 03, 2023 at 09:22:22AM +0200, Juri Lelli wrote: > Dietmar Eggemann (2): > sched/deadline: Create DL BW alloc, free & check overflow interface > cgroup/cpuset: Free DL BW in case can_attach() fails > > Juri Lelli (4): > cgroup/cpuset: Rename functions dealing with DEADLINE accounting > sched/cpuset: Bring back cpuset_mutex > sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets > cgroup/cpuset: Iterate only if DEADLINE tasks are present > > include/linux/cpuset.h | 12 +- > include/linux/sched.h | 4 +- > kernel/cgroup/cgroup.c | 4 + > kernel/cgroup/cpuset.c | 242 ++++++++++++++++++++++++++-------------- > kernel/sched/core.c | 41 +++---- > kernel/sched/deadline.c | 67 ++++++++--- > kernel/sched/sched.h | 2 +- > 7 files changed, 244 insertions(+), 128 deletions(-) Aside from a few niggles, these look fine to me. Who were you expecting to merge these, tj or me?
On 04/05/23 08:25, Peter Zijlstra wrote: > On Wed, May 03, 2023 at 09:22:22AM +0200, Juri Lelli wrote: > > > Dietmar Eggemann (2): > > sched/deadline: Create DL BW alloc, free & check overflow interface > > cgroup/cpuset: Free DL BW in case can_attach() fails > > > > Juri Lelli (4): > > cgroup/cpuset: Rename functions dealing with DEADLINE accounting > > sched/cpuset: Bring back cpuset_mutex > > sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets > > cgroup/cpuset: Iterate only if DEADLINE tasks are present > > > > include/linux/cpuset.h | 12 +- > > include/linux/sched.h | 4 +- > > kernel/cgroup/cgroup.c | 4 + > > kernel/cgroup/cpuset.c | 242 ++++++++++++++++++++++++++-------------- > > kernel/sched/core.c | 41 +++---- > > kernel/sched/deadline.c | 67 ++++++++--- > > kernel/sched/sched.h | 2 +- > > 7 files changed, 244 insertions(+), 128 deletions(-) > > Aside from a few niggles, these look fine to me. Who were you expecting > to merge these, tj or me? Thanks for reviewing! Not entirely sure, it's kind of split, but maybe the cgroup changes are predominant (cpuset_mutex is probably contributing the most). So, maybe tj? Assuming this looks good to him as well of course. :) Thanks!
On Thu, May 04, 2023 at 10:17:41AM +0200, Juri Lelli wrote: > On 04/05/23 08:25, Peter Zijlstra wrote: > > On Wed, May 03, 2023 at 09:22:22AM +0200, Juri Lelli wrote: > > > > > Dietmar Eggemann (2): > > > sched/deadline: Create DL BW alloc, free & check overflow interface > > > cgroup/cpuset: Free DL BW in case can_attach() fails > > > > > > Juri Lelli (4): > > > cgroup/cpuset: Rename functions dealing with DEADLINE accounting > > > sched/cpuset: Bring back cpuset_mutex > > > sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets > > > cgroup/cpuset: Iterate only if DEADLINE tasks are present > > > > > > include/linux/cpuset.h | 12 +- > > > include/linux/sched.h | 4 +- > > > kernel/cgroup/cgroup.c | 4 + > > > kernel/cgroup/cpuset.c | 242 ++++++++++++++++++++++++++-------------- > > > kernel/sched/core.c | 41 +++---- > > > kernel/sched/deadline.c | 67 ++++++++--- > > > kernel/sched/sched.h | 2 +- > > > 7 files changed, 244 insertions(+), 128 deletions(-) > > > > Aside from a few niggles, these look fine to me. Who were you expecting > > to merge these, tj or me? > > Thanks for reviewing! > > Not entirely sure, it's kind of split, but maybe the cgroup changes are > predominant (cpuset_mutex is probably contributing the most). So, maybe > tj? Assuming this looks good to him as well of course. :) Yeah, they all look sane to me and both Waiman and Peter seem okay with them. If you post an updated version with the minor suggestions applied, I'll route the series through the cgroup tree. Thanks.
Hi, On 05/05/23 09:31, Tejun Heo wrote: > On Thu, May 04, 2023 at 10:17:41AM +0200, Juri Lelli wrote: > > On 04/05/23 08:25, Peter Zijlstra wrote: > > > On Wed, May 03, 2023 at 09:22:22AM +0200, Juri Lelli wrote: > > > > > > > Dietmar Eggemann (2): > > > > sched/deadline: Create DL BW alloc, free & check overflow interface > > > > cgroup/cpuset: Free DL BW in case can_attach() fails > > > > > > > > Juri Lelli (4): > > > > cgroup/cpuset: Rename functions dealing with DEADLINE accounting > > > > sched/cpuset: Bring back cpuset_mutex > > > > sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets > > > > cgroup/cpuset: Iterate only if DEADLINE tasks are present > > > > > > > > include/linux/cpuset.h | 12 +- > > > > include/linux/sched.h | 4 +- > > > > kernel/cgroup/cgroup.c | 4 + > > > > kernel/cgroup/cpuset.c | 242 ++++++++++++++++++++++++++-------------- > > > > kernel/sched/core.c | 41 +++---- > > > > kernel/sched/deadline.c | 67 ++++++++--- > > > > kernel/sched/sched.h | 2 +- > > > > 7 files changed, 244 insertions(+), 128 deletions(-) > > > > > > Aside from a few niggles, these look fine to me. Who were you expecting > > > to merge these, tj or me? > > > > Thanks for reviewing! > > > > Not entirely sure, it's kind of split, but maybe the cgroup changes are > > predominant (cpuset_mutex is probably contributing the most). So, maybe > > tj? Assuming this looks good to him as well of course. :) > > Yeah, they all look sane to me and both Waiman and Peter seem okay with > them. If you post an updated version with the minor suggestions applied, > I'll route the series through the cgroup tree. Thanks for reviewing and eventually taking care of the series. v3 just posted (20230508075854.17215-1-juri.lelli@redhat.com). Best, Juri