From patchwork Thu Mar 30 13:55:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Newman X-Patchwork-Id: 7473 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1151673vqo; Thu, 30 Mar 2023 07:05:45 -0700 (PDT) X-Google-Smtp-Source: AKy350ZC17RpuKXyR0lyV3/SCXgnhYGBZWzjL6UBUmsL1QPUjP/qbMQSJHApDyndTzmVYv+8VZcG X-Received: by 2002:a17:902:e3c2:b0:1a0:4b9a:bae6 with SMTP id r2-20020a170902e3c200b001a04b9abae6mr18908118ple.30.1680185144996; Thu, 30 Mar 2023 07:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680185144; cv=none; d=google.com; s=arc-20160816; b=lv8CvzAZCiWt6tHxui+qIZwQnmF7HvISJ11AMJNZXvnrBCyOg0T9Y+gYhwFHbSQM+w a1rsU/m1uCWhd1jmfHudChzzbV4CKYl1W7IYCOZEEufdVoGkIPjAv65gJl4wnMGFlnz9 YQT0A4LSJ2TxdZmIMVexrf51Wjv74vrF+EKwRsgBGhwlBCktmaQqe3mDdcaAxwlV3jgN kPGnU8SDDXYpCsfKh0XJx14/uoCA2iMZiRTYTkZVeuzOZtquMLe9Ova3Ns0gaTYT6RPp 1OXsvcq7AWBTdGqzt3QwC8X5Ew9ne8wscWGVMDoHW5qXrNZMA3AHZmwtFeW5UphAR/lH uRSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=2Jw1BbU3G1vWWd2aYAwIMv2kp7z100nGjWlqtflgrAc=; b=CVW23S9hBeSQ9o6kDXog4uSnxwozakvIwZkit6l9rEiyYS7gpDgzn+Zhc7eFF+rLMf cs1GoS6EsKIEsMcUEP2AGZO+pUTS5QAiwXzGg8j53Izl2sf99F4Cg73hiJrq4XDlqb7I EBHZfhbhvffdjg71jo7bzquKIFKPdAeuJifcErl5zmLU8UsTT3FC0+q6Aj6/BcufGb8B azRslnLgt5nobJ2iT+M+BgHYsMYEIRotv/Lj9txUdVOSystUzd8hjmxfoKJosp3bh8Ab mVrjCg4h9hHLNPMG4UCvzPyUw0iaURnFk07uH6SYX296f71rd3Ce23gN246SNmRp02C9 AiFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EohCILKk; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj28-20020a056a02019c00b0050be565b854si12051862pgb.829.2023.03.30.07.05.29; Thu, 30 Mar 2023 07:05:44 -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=20210112 header.b=EohCILKk; 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 S232063AbjC3N4N (ORCPT + 99 others); Thu, 30 Mar 2023 09:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjC3N4L (ORCPT ); Thu, 30 Mar 2023 09:56:11 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D647F5266 for ; Thu, 30 Mar 2023 06:56:09 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id f66-20020a255145000000b00b714602d43fso19056761ybb.10 for ; Thu, 30 Mar 2023 06:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680184569; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=2Jw1BbU3G1vWWd2aYAwIMv2kp7z100nGjWlqtflgrAc=; b=EohCILKk2TdGha5zOMheE+fnG+ota0CGyE78J0LgoRSYqdGJD94O8sTgmZH8vREJky 7bs47pZR0rZxDBjj+hWUSCSALuDVrgD4WGUY//Xa6TFJ31mpRbSB+iL7AXLzXMVmzuIA mFF0fdaFRveeQnElVcd5FBoLJQOIRBqJnbQF0uxqCC2Vkpa/WELoLOz9cx10B1+wzeBh JsrPkb4telwRT6rYezqEEpwpML0C5VOpXuelj3lGzRG9jnz/Fnsnf8rHVq907FdOphmk 9ZqU6zIjHbsKTC1owIHqwU7wMXo3Ddv0tCyCJDAN+qtDzV+RtmAX9ugY1zyusRtgqn3p Du4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680184569; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2Jw1BbU3G1vWWd2aYAwIMv2kp7z100nGjWlqtflgrAc=; b=yG5mWgujEZA55EL6CaTidjGsn1ygOHLnAHEZLAixNCZ2cn1uFM9hiN7EddkTiufzMm /OvaGoPa2yaqn/E1P2sTvSLydHt2CXj/wYIwczaYSPfnTnCQsekfHRdu91pOSi61+0Nt ijuqa/rno+DKYq/sCpN1tOI6WpKx23LUoflYas8a1AORJexL0pGlXR3pm0BZV4bp/+12 4LVzepWqubmUBTcmr8QG+FAMvW8QdpXbfi6fq/mD5xW/6kMisO/EL1RPRKyam5hjvxDc MU19TkdzycQMHBx40z3Yg/fz+1wq+v1h/XItF1xhs1anXHFSkBXuy2XKapooZ1iQLfEA vDUw== X-Gm-Message-State: AAQBX9cRGD4tQOzeh/2NsVcbX/p+UXnv3cEv2RpySqIG00Bypeg+EPRY 5eDbrx1XTcaKy2DeUVuVyKJrAqUffi0X/1MJ4w== X-Received: from peternewman-vh.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:30cc]) (user=peternewman job=sendgmr) by 2002:a81:bc0c:0:b0:545:612a:c04a with SMTP id a12-20020a81bc0c000000b00545612ac04amr11140543ywi.8.1680184569073; Thu, 30 Mar 2023 06:56:09 -0700 (PDT) Date: Thu, 30 Mar 2023 15:55:55 +0200 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230330135558.1019658-1-peternewman@google.com> Subject: [PATCH v5 0/3] Subject: x86/resctrl: Implement rename to help move containers' tasks From: Peter Newman To: reinette.chatre@intel.com, fenghua.yu@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, skodak@google.com, tglx@linutronix.de, tony.luck@intel.com, x86@kernel.org, Peter Newman X-Spam-Status: No, score=-7.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761801818489523721?= X-GMAIL-MSGID: =?utf-8?q?1761801818489523721?= Hi Reinette, Fenghua, This patch series implements the solution Reinette suggested in the earlier RFD thread[1] for the problem of moving a container's tasks to a different control group on systems that don't provide enough CLOSIDs to give every container its own control group. This patch series assumes that a MON group's CLOSID can simply be changed to that of a new parent CTRL_MON group. This is allowed on Intel and AMD, but not MPAM implementations. While we (Google) only foresee needing this functionality on Intel and AMD systems, this series should hopefully be a good starting point for supporting MPAM. Thanks! -Peter Updates: v5: - rebase to v6.3-rc4 - dropped rdt_move_group_tasks() task filter patch - code/comment clarifications and errno updates requested by Reinette - added Documentation patch v4: - rebase to v6.2 - commit message updates suggested by Reinette - replace rdt_move_one_task() patch with rdt_move_group_tasks() filter function patch - prevent rename on files or renaming to "mon_groups" - optimize simple rename case - disallow renaming groups with non-empty cpumask - ensure source is a proper MON group directory - fix missing rdtgrp->closid update - add more last_command_status output v3: use revised task CLOSID/RMID update IPI sync method from [3] v2: reworded change logs based on what I've learned from review comments in another patch series[2] [v1] https://lore.kernel.org/lkml/20221115154515.952783-1-peternewman@google.com/ [v2] https://lore.kernel.org/lkml/20221129120149.1035444-1-peternewman@google.com/ [v3] https://lore.kernel.org/lkml/20230125101334.1069060-1-peternewman@google.com/ [v4] https://lore.kernel.org/lkml/20230308131452.383914-1-peternewman@google.com/ [1] https://lore.kernel.org/lkml/7b09fb62-e61a-65b9-a71e-ab725f527ded@intel.com/ [2] https://lore.kernel.org/lkml/54e50a9b-268f-2020-f54c-d38312489e2f@intel.com/ [3] https://lore.kernel.org/lkml/20221220161123.432120-1-peternewman@google.com/ Peter Newman (3): x86/resctrl: Factor rdtgroup lock for multi-file ops x86/resctrl: Implement rename op for mon groups Documentation/x86: Documentation for MON group move feature Documentation/x86/resctrl.rst | 7 ++ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 163 +++++++++++++++++++++++-- 2 files changed, 157 insertions(+), 13 deletions(-) base-commit: 197b6b60ae7bc51dd0814953c562833143b292aa