Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp16150rwr; Wed, 19 Apr 2023 02:43:15 -0700 (PDT) X-Google-Smtp-Source: AKy350ZPbYvD1qNm9T0MY06+syUyHLa+nqnjgPJCg5CcaGccPRZhAlT/jqdKmllqB2FogapgRlBe X-Received: by 2002:a17:903:230b:b0:1a0:57dd:b340 with SMTP id d11-20020a170903230b00b001a057ddb340mr5507294plh.64.1681897395541; Wed, 19 Apr 2023 02:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681897395; cv=none; d=google.com; s=arc-20160816; b=ARS4ZcT3JpxNQZAGOb7o12lVmv+424RxpmIt9wCA5AMzXhOqpkDLcQCLBvapF5yEwm vD587WTnURHi469SntQdQz6BYxKQXKoHLoLiL/k3UWjwNR1LQNn6/B83Xqxdeymc/bCo ij+ZnV9rXEJyXNQNspui4lHzhpLt30QRyLct+1FcEjMwKxCAQ9+N/xGsmppaCLJVdUCE 5/zyDU0kSfLVJU9sbUANPad6gNdufGrysJyWHVgL5QSm+XMgGzYdAR6himYb3r0yabUz 6Tsv+JY7BZ8eNb3uFE0bpfFzA9SxNt7zMRuzuYy/Qd6vhovjNEJ+ncyiIs3X8Bp4zQ11 dUvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=x66QzDZ9/BUdWw72YlPvhWLdY9LAQaHM++rc6k3qv3A=; b=fL9HYptP0+KFFIoyGfk3vo02VPu9poZaIwkvSvhaECrWMZVm5sS1LEojLl7VCS/+gj ccHD3tMS4RwoBstk1pxtsNjrkAn8Dy+jU6DfssXUppRcnjQrMcxIMaoYbYsn5dYk7NFy WoJdGiedSJoXCh3zNUlb3lsEKBKG2EBoq88ygeXOhxZGdckkwwhhltmd2BI6x+aZ44Jo Bcvdn1Km4DcYTijp5Fxkbl7Tf23O2xE1Bh7ADXnhgyMdVqwwvMrTEJjA4LlrzNmV+uPn PBy1zBbXgZfCSj4FsoiCVy3xcErahAhDIhNjk1kABC1t1tAFmjtW8f0WIqDT5Bsl75dY d5fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="OR/s+xsk"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h21-20020a170902ac9500b001a68bbbaaa5si15355709plr.593.2023.04.19.02.43.04; Wed, 19 Apr 2023 02:43:15 -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=@google.com header.s=20221208 header.b="OR/s+xsk"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231895AbjDSJjG (ORCPT + 99 others); Wed, 19 Apr 2023 05:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231660AbjDSJjF (ORCPT ); Wed, 19 Apr 2023 05:39:05 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED8E5106 for ; Wed, 19 Apr 2023 02:39:03 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-3ef34c49cb9so457861cf.1 for ; Wed, 19 Apr 2023 02:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681897143; x=1684489143; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=x66QzDZ9/BUdWw72YlPvhWLdY9LAQaHM++rc6k3qv3A=; b=OR/s+xskjH5uUgZDXygguLsq2rxs8F4EKlVMajXm+3MbtFEcDvYFoC0HLWe+BQbJim OKnNoDCxfG1i6M1taxHV6GCXBDoUBelGRXmCh1CCi6HbCSFp+AemvTYMMPWp46giyI2V 9M+L7oRV1zK4XhTBd27GRYiBn+6vxVnlZ7vlIXFxVXN6olxwuK7BNvvInZNmYoA99vQ7 vRg7cItczdxDc3NV+/YCpJEaxIXlX7rtWIy4A00yP4y0xPlyBOSvdPh4hdILOPWhav1n +E11SKvbhTjn+9SWdp0YFwoZ9MaaTjLkJfY22mtYcKuzWHfAdEjNgwew99Tp7uSUwITP Iptg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681897143; x=1684489143; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x66QzDZ9/BUdWw72YlPvhWLdY9LAQaHM++rc6k3qv3A=; b=PmApvtFmYR4KeqMXOXDXfNGhQpQShSJ9niDNI4FPfxKhMRS2jsNyXLlf1k80d2/GhS HnEjXiJbRkvSB9tVRO974OJbCijhzSerqZmAQapU8sOjARKdSguY0Yb8kIC6i/Nqhvkz 7jPipnccrDMlVUgxiP6akeUPV2FoNluajJFWMTPSfMOZmJMY0Ey7ADKtuh3Oi7oRVruG lf6JpBLVOv4y7EZN8AHn1992MxHSMc7p7JDMAqmdvdt1tSDp5J8oV88K+IkMWaYzaq9Z 6rwp3TzOu6Ej55l8Pp04qTt9cE/nRIeOP1/DmXtwXcnN3Ze7fV9y/GE+SJnmW9UgAgOy 9Q8w== X-Gm-Message-State: AAQBX9c2GXdWQ131o+t0wrKxJJ6hbn9iNdiqVwx8sS8FNaBVyC6OLBwn WyiYG0gFbVmNCBG9mnVe2ZA7gESftU1Y69h03QVq9w== X-Received: by 2002:a05:622a:1a19:b0:3ef:3cac:c464 with SMTP id f25-20020a05622a1a1900b003ef3cacc464mr343772qtb.8.1681897143041; Wed, 19 Apr 2023 02:39:03 -0700 (PDT) MIME-Version: 1.0 References: <20230330135558.1019658-1-peternewman@google.com> <20230330135558.1019658-3-peternewman@google.com> <678ab8b6-9465-cdeb-da65-448c0cf075f5@intel.com> In-Reply-To: <678ab8b6-9465-cdeb-da65-448c0cf075f5@intel.com> From: Peter Newman Date: Wed, 19 Apr 2023 11:38:52 +0200 Message-ID: Subject: Re: [PATCH v5 2/3] x86/resctrl: Implement rename op for mon groups To: Reinette Chatre Cc: fenghua.yu@intel.com, Babu.Moger@amd.com, bp@alien8.de, dave.hansen@linux.intel.com, eranian@google.com, gupasani@google.com, hpa@zytor.com, james.morse@arm.com, linux-kernel@vger.kernel.org, mingo@redhat.com, skodak@google.com, tglx@linutronix.de, tony.luck@intel.com, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On Tue, Apr 18, 2023 at 11:53=E2=80=AFPM Reinette Chatre wrote: > On 3/30/2023 6:55 AM, Peter Newman wrote: > > If a container manager is additionally tracking containers' bandwidth > > usage by placing tasks from each into their own monitoring group, it > > The above sentence seems to be missing something after the "for each". > It seems to still parse if "for each" is removed. Did you mean "from each"? In any case, I'll further disambiguate to this in my next update: "If the container manager is using monitoring groups to separately track the bandwidth of containers assigned to the same control group, it must first move the container's tasks to the default monitoring group of the new control group before it can move these tasks into the container's replacement monitoring groups under the destination control group." > > + /* > > + * Don't allow kernfs_to_rdtgroup() to return a parent rdtgroup i= f > > + * either kernfs_node is a file. > > + */ > > + if (kernfs_type(kn) !=3D KERNFS_DIR || > > + kernfs_type(new_parent) !=3D KERNFS_DIR) { > > + rdt_last_cmd_puts("Source and destination must be group d= irectories"); > > I do not think it is obvious what a "group directory" is. The source must= be a > monitoring group and the destination must be the "mon_groups" directory. = Maybe > the "group" term can just be dropped to read "Source and destination must= be > directories" (which is exactly what is tested for). Sounds good. > > > + ret =3D -EPERM; > > + goto out; > > + } > > + > > + if ((rdtgrp->flags & RDT_DELETED) || (new_prdtgrp->flags & RDT_DE= LETED)) { > > + ret =3D -ENOENT; > > + goto out; > > + } > > + > > + if (rdtgrp->type !=3D RDTMON_GROUP || !kn->parent || > > + !is_mon_groups(kn->parent, kn->name)) { > > + rdt_last_cmd_puts("Source must be a MON group\n"); > > + ret =3D -EPERM; > > + goto out; > > + } > > + > > + if (!is_mon_groups(new_parent, new_name)) { > > + rdt_last_cmd_puts("Destination must be a mon_groups subdi= rectory\n"); > > + ret =3D -EPERM; > > + goto out; > > + } > > + > > Thanks. I think using these terms ("MON" and "mon_groups") in the error m= essages > are useful since it gives the user something to search for in the documen= tation. > > > + /* > > + * If the MON group is monitoring CPUs, the CPUs must be assigned= to the > > + * current parent CTRL_MON group and therefore cannot be assigned= to > > + * the new parent, making the move illegal. > > + */ > > + if (!cpumask_empty(&rdtgrp->cpu_mask) && > > + (rdtgrp->mon.parent !=3D new_prdtgrp)) { > > You can remove the extra parentheses so that this patch can get a clean s= late > from "checkpatch.pl --strict" done as this work moves to the next level. Ok > > Thank you very much. > > Just the few minor comments. With those addressed: > > Reviewed-by: Reinette Chatre Thanks again for your careful review. Also thank you for suggesting this solution. It's a big improvement in maintainability over what we've been using downstream. -Peter