Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2861808rwb; Fri, 16 Dec 2022 07:23:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf49oE2bOogk4N9jPCfEEcfDF6cf/4Yb3D+Kf8ohPrVAZk3+xkMwy5zvoNlRW/ULH3XJVnUS X-Received: by 2002:a05:6402:4284:b0:45c:835c:eab7 with SMTP id g4-20020a056402428400b0045c835ceab7mr29277379edc.37.1671204196234; Fri, 16 Dec 2022 07:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671204196; cv=none; d=google.com; s=arc-20160816; b=wvGzqXN4xOZGWaxDJOQQohhEhPmTJoSikXFzx1XFtzutdoLChS38FA6XFL0MI10ezp yyk4gGWdFyC1bKOh3Ef8wbH8QwOwYv5cMGOJ9hbrn/p3hEiMqxPvm0HZmqJekoLB3bI7 JJgn4/31iWFX2o4G+YPX1ge3qkuahOxcpiUBeG4QyrlUveJJHea4VNIY6f2FYAd0GlBk MMOBOCsNcwVGUHJD1hso0Vsm1R3JrK0oC7j77COdwQE+g6YizV60sZY113mteAZBusaw HxFnmhySRtUA7vBbISUlLFHQ6Pe05v3TFRxKuJT/IdyKYRvM/ykRQ1j1CkVS4ohq4NSG c4pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cEcm9v6GuPGdbYufJ/cY13zsBhQTOYOSWCvpcJyORqE=; b=UWz5PKxS1n2WkX+Mh6Vo/ZUlWDaMw6A0zWMCyQE7hUm9jZF9q60p4EAjsBRjn/6F1k cbeixIfPTpdX2vNP+Xy+XsO9DOk2FCLRh61vJUt0EqbXQkundMH7W83S9pXvQxwdVFnT JJ11EF6Lue6xMvGfoy9sVWP2OQiNILRH+ZkpXS4up8rClcInLaxkIStxnvk8PFTSPKSE VLXmtdf4xy0UJuh1BBfhc4t3xW5L9akJACkXyR19j/PCcIPYoDLczPE7CRi0XD7OWT7I 9runm0d5gc+WkSj3Skr/sIcUN+AVD/23BPQILs8Hbn/3dGZFV0Su0JiJI8LekCVtpt/C U7lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=neargoPY; 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 q13-20020a056402518d00b00461c0fd2597si3134542edd.89.2022.12.16.07.22.59; Fri, 16 Dec 2022 07:23:16 -0800 (PST) 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=20210112 header.b=neargoPY; 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 S231359AbiLPPNA (ORCPT + 69 others); Fri, 16 Dec 2022 10:13:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231284AbiLPPM6 (ORCPT ); Fri, 16 Dec 2022 10:12:58 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36225101D7 for ; Fri, 16 Dec 2022 07:12:57 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id g7so2905351qts.1 for ; Fri, 16 Dec 2022 07:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cEcm9v6GuPGdbYufJ/cY13zsBhQTOYOSWCvpcJyORqE=; b=neargoPYa7EHGiZZxT0Yjv/CXXLVssqTRf+eNPnUo/gwb+jeuCq6WFbowIkjg+Yft8 uYvbj/TMRwPueX54IgmZrzAejJSunRYZyB3Uzt7ZUjg/R3J/Hew2+VGbpBaQnS+pH//w sTud7ELaLtAAbSG6/MzEpvEG+RWhPaLJ1Ey5Tu1XYUz7DuqYPb1BYlApMagfMvS9cjfU gHWHSFzgZr1q5O4/L2T0Sw8CezMmoohKlx44r0VOGJgQMgUMfBeI2myKkSdWUQMQ8ryA t8/Jv+O7gRFcfAP6BtMxyQ0jpQ0bXM5eicNPOwWOyGrqUbIcMV9gwozzbzNJ4aboLZ5a x5Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=cEcm9v6GuPGdbYufJ/cY13zsBhQTOYOSWCvpcJyORqE=; b=RrAGWOp8W6AdBF01vSZKZES3cOMhbl7zDMQBnVmqTbZMF4kLB7KjcTHmxivefL3ugv qRx3jVrOqwQHsra4PukXr3eW4RyoaLCQlmgUb+nNwcob6TtJGabD7KgJTlG5+QwnfxHf kmPZE3qfqpq1jOP5IlKTRGyX5S5zjyqXsqFLy5cYJjVgM8fKz7cGj/hVMK16LFPyCfLz ILKfs9/xAFvNYxFL/WqMBhIXWgr4Ilj+K+8qRxkv9MtGV2UHVfXtAVeAhIkzmOTL5AxN snD0n0yPII7KtqF39mL0F8/xYITrCCyQ2KG7galBNMufPo6RxsazjcykiadeUwANSw10 WLRQ== X-Gm-Message-State: ANoB5pkbDFM1kyunFchLhurrNNE2Lkh0ceWcdnAJBn5xC7nfdygGSzHU Ay1drj9IjCAVRY+iJZCuHYwHRvf/iivu/Y2LHV2qeg== X-Received: by 2002:ac8:7ef9:0:b0:3a7:f4ca:c2d1 with SMTP id r25-20020ac87ef9000000b003a7f4cac2d1mr5775203qtc.368.1671203576203; Fri, 16 Dec 2022 07:12:56 -0800 (PST) MIME-Version: 1.0 References: <20221129120149.1035444-1-peternewman@google.com> <20221129120149.1035444-3-peternewman@google.com> In-Reply-To: <20221129120149.1035444-3-peternewman@google.com> From: Peter Newman Date: Fri, 16 Dec 2022 16:12:45 +0100 Message-ID: Subject: Re: [PATCH v2 2/2] x86/resctrl: Implement rename op for mon groups To: fenghua.yu@intel.com, reinette.chatre@intel.com Cc: 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, tglx@linutronix.de, x86@kernel.org Content-Type: text/plain; charset="UTF-8" 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, 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 On Tue, Nov 29, 2022 at 1:02 PM Peter Newman wrote: > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 03b51543c26d..d6562d98b816 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -3230,6 +3230,71 @@ static int rdtgroup_rmdir(struct kernfs_node *kn) > return ret; > } > > +static void mongrp_move(struct rdtgroup *rdtgrp, struct rdtgroup *new_prdtgrp) > +{ > + struct rdtgroup *prdtgrp = rdtgrp->mon.parent; > + struct task_struct *p, *t; > + > + WARN_ON(list_empty(&prdtgrp->mon.crdtgrp_list)); > + list_del(&rdtgrp->mon.crdtgrp_list); > + > + list_add_tail(&rdtgrp->mon.crdtgrp_list, > + &new_prdtgrp->mon.crdtgrp_list); > + rdtgrp->mon.parent = new_prdtgrp; > + > + read_lock(&tasklist_lock); > + for_each_process_thread(p, t) { > + if (is_closid_match(t, prdtgrp) && is_rmid_match(t, rdtgrp)) > + WRITE_ONCE(t->closid, new_prdtgrp->closid); > + } > + read_unlock(&tasklist_lock); > + > + update_closid_rmid(cpu_online_mask, NULL); I will need to refresh this patch now that we're back to building an update mask. This will once again depend on https://lore.kernel.org/lkml/20221216133125.3159406-1-peternewman@google.com/