From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 627F3371D01 for ; Wed, 12 Aug 2026 02:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.167.42 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786503499; cv=pass; b=AS8oH4Y/psKPVdD98AZ7RQfw9I3zj88jPWSEjc+hB6SiCccpLb+EwjCtAaSBVqes0+ouxy5+7Emwp6edykJhgIjCLdbk5szCDrKVV2qyWAW1qM4PEtLolvGdLD8XDLom4rSv6Pp1EwbUBgC3pXofHrYhFv4OSL1r9IBU9jQ/GOE= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786503499; c=relaxed/simple; bh=1GXEgKb8AtQjGH3gyVhgQKefT0eOIVlPpWz4VPRvhEg=; h=From:References:Mime-Version:In-Reply-To:Date:Message-ID:Subject: To:Cc:Content-Type; b=uG4PTwG6eWc5wpRkXAk+9bgbJoKL7LbkoOKyJsD44/a9lgr+E/rrftp1bEdmqxaV/ecOnn27ORv5TSy+woFVbD8KsqxAznr/JskmO3G4ndPpd2xE7K/N3OzbhQYejmuo390GZBCAO8dI0XEDSKJW3TeJ9pKVIdi/O8xg/tjeFjk= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=kUjSJ2Of; arc=pass smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="kUjSJ2Of" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5b011edaf7dso431965e87.2 for ; Tue, 11 Aug 2026 19:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786503495; cv=none; d=google.com; s=arc-20260327; b=fl9Fx1t4q6VJBaLPlnYya2bhC/sAbJARDuyqHQe9YNmW0VOEIDEGqEOb9JcsITfUCO icHfjh7v8i02kznUC9Wp2rqSiErQjnPEfFsZJEpyTdNgh45dP6oRiUZFIBzELL1ZkOk3 ye590ZvEHuO8a6mYvPJLDMw5UvaJVeYWVN4c1mW59rR5oih1Ellrsf2ZRO6ME60iOV5S KiL1UrkSwlXfF4y+2GrghFtIc9VoStuMKQ1V7SH9TPoNv9oi3el4myrCGNHqhEUMPSI4 ToZoI9oI1cUqJUxcNDJltTnvzeI8TXVG5dQHMH584zjssnAweqMpe0RfLscweQEPNrGS 8MYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:user-agent:in-reply-to:mime-version :references:from:dkim-signature; bh=i7nGgYKvE3Q27EURwBk0VQlh8/ubhEqw0Zh7p9xqrfQ=; fh=iXq0e9VTEs9FZ3iUhJwYj4QkyLGfHDnpdMn6cN8O6tA=; b=fl3xhvEHmGSDRWkE2dJOtgTGfxFZBO+kQPLTpw+hJ6j+Xr0EzEmK9JeLobn/+1orzn xmzPRLWkRIwXL6g/bUtujgzhpxDJV4z23tHhL9KUCSR3AvaDf5mKv20fHaPOWcl1e6Bj JmYUcMVzLPmsBh6SxcogJ+5CnCenXKth8ET2JskW7Nj9X6d2e8OPxSw84rKH0a6vMVtC L6aIPDRbA+aUosP+Vd1U7XciQJIquBBfXkclDhF/MYQDFO/toJdm+nS7/WP9fWrrRkae 7SP5mMvkyjaiAmDl441APGMVWeF9Lc9ZdF1mBjnptEEZw+Se4Rt/Sac7Nshp3W9PHsg1 rUTA==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1786503495; x=1787108295; darn=vger.kernel.org; h=content-type:cc:to:subject:message-id:date:user-agent:in-reply-to :mime-version:references:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=i7nGgYKvE3Q27EURwBk0VQlh8/ubhEqw0Zh7p9xqrfQ=; b=kUjSJ2OfziBFDCsEZO+vtkwbZkLfm6Go9ptw3q0gbUrS2jO6eQuk7B8ON23qPcBcV0 6U2IluZ661geys8adRY8YBZViERQj7V7bflmb1HlIjnpGeq5tXgYaihifvFi9ODR4evI IzL+UpbnO7izLzGKNWgS0S3NI46jsycIqZvy7ETtkQGapJt1fN6HJ9Nvmh54f4F6NxTp 5dPKx0lgbk8oeVLhUcApCs1vizHBvEgSn1P8RqF3PhuzyqjkekLegYZWdsmPsOYXG9xn 2ng5M6kmTzCKjvpxhPhidICWo2cl5blg+3juaq0Z+pESltOgs8/+ccsSYRAQfXb6cLHR yUBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786503495; x=1787108295; h=content-type:cc:to:subject:message-id:date:user-agent:in-reply-to :mime-version:references:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=i7nGgYKvE3Q27EURwBk0VQlh8/ubhEqw0Zh7p9xqrfQ=; b=PKi+KP2GQxd2WKWsbQFzwiWI0nmP5PM8AENU/1Lb+GeZHGeTs4cd5Z2VKIabsbXu0M nvW6xBYlADlNgOq/7NqjmOoOuoWDvUOIeZknSDeL6p6+Gtpvkx1foB5OoQsQIIJROC/I Vd8LnfA36zyC/t9EXT7YBvt//w8kONrWzMSDchiIXjO/P0JLKuO+1NCcljSozgICGWqS cXaxfV7xSF166ruiuG1njtp2ievRYy1sXBI775VTgH7MH3EbdhS9GQJaN+csXItV+DS/ BLPl6krv/NOnt+/4DIRn5xmF0875v6Cu5V1dmT7VJ8UEx6d85URrGRYmq1+kepFOY0E3 dtCQ== X-Forwarded-Encrypted: i=1; AHgh+RpWA1SgE10eDbOnlvy76slPnLA+EWZaqLkzhN3vTomVuiQA4JVuFLMAtgrYtrYnFgD12263tHyLmbUXc54=@vger.kernel.org X-Gm-Message-State: AOJu0Yy4IISTc/hP1KNXDlbt5tTcZIDRxSxR4ql+vorhbXAKWjqDbgAD qj85++28Vqu2nQ/eFHyV0K0gGK+s2cxDiLEpQWrBlFdxW6nf6YmmPBx5t9Yxeq5BteKqnsed9M+ Ml0oOp9R6apwEEmFZjIfZHMdLKEE1UupW/f7K0f8/Cw== X-Gm-Gg: AR+sD11FRWM1Ob2qP1fhRaZJW3ASq8RArfyaRq6GL3SN5LGSA+amoexws4Q4Y/pe+HS Ndw/+FfqZBq9tc8F0TRVFf9IdVTNn9yzoUzRvJj74QKzkLzXGGhieAgGkqYrRzFMHoDxqGS4ro5 3of0fn9+oEVkL7bHiz77f17IcC8QpCnaHaE8Vkfpk5MLdTqhQj0J13Q0rFKOs/qpcl2t1JrlONT 0yuEzDOJKYOj4eurSKwB7BLs0sKsqoQCp7+uGfxewqf6IRQ884N96nTC9U6H1sWSd5GM5MPzKuY NDXWH6ff1xRxtF7X4bwopOcSMjyp2CA/BbFL9ipjmJE7GTZZH7GLp4fX X-Received: by 2002:a05:6512:6883:10b0:5ae:ba47:e7bb with SMTP id 2adb3069b0e04-5b44e327b7emr127630e87.36.1786503495339; Tue, 11 Aug 2026 19:58:15 -0700 (PDT) Received: from 44278815321 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Aug 2026 19:58:14 -0700 Received: from 44278815321 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Aug 2026 19:58:14 -0700 From: Zhanpeng Zhang References: <20260714130657.46963-1-zhangzhanpeng.jasper@bytedance.com> <20260714130657.46963-4-zhangzhanpeng.jasper@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: X-Original-From: Zhanpeng Zhang User-Agent: Mozilla Thunderbird Date: Tue, 11 Aug 2026 19:58:14 -0700 X-Gm-Features: AUfX_mxvwZ83pSWvPns7jRPE3EZ4ROM6a0cFBGgGRZzehYP0r9bHWpi6TB0BXXM Message-ID: Subject: Re: [RFC PATCH 3/7] resctrl: Add a devices file for external requester assignment To: Drew Fustini Cc: joro@8bytes.org, palmer@dabbelt.com, tony.luck@intel.com, reinette.chatre@intel.com, tomasz.jeznach@linux.dev, will@kernel.org, robin.murphy@arm.com, pjw@kernel.org, aou@eecs.berkeley.edu, alex@ghiti.fr, Dave.Martin@arm.com, james.morse@arm.com, babu.moger@amd.com, corbet@lwn.net, shuah@kernel.org, jgg@ziepe.ca, kevin.tian@intel.com, cuiyunhui@bytedance.com, yuanzhu@bytedance.com, iommu@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Hi Drew, On 8/12/26 10:19 AM, Drew Fustini wrote: > On Tue, Jul 14, 2026 at 09:06:53PM +0800, Zhanpeng Zhang wrote: >> Do not overload the resctrl tasks file with architecture-specific >> non-PID tokens. The tasks ABI remains a list of task IDs, while the new >> devices file carries external requesters assigned to a resctrl group. >> >> Add architecture hooks for assigning and showing those external >> objects, and reject group removal, reparenting, or pseudo-lock setup >> while devices are still assigned. The teardown path performs a >> best-effort reset to the default group. >> >> The devices file is an assignment interface only. It does not describe >> a new resource schema or domain; resource allocation and monitoring >> policy remain described by the existing schemata and info files. >> >> Signed-off-by: Zhanpeng Zhang >> --- >> Documentation/filesystems/resctrl.rst | 26 ++++ >> arch/Kconfig | 6 + >> fs/resctrl/rdtgroup.c | 206 +++++++++++++++++++++++++- >> include/linux/resctrl.h | 45 ++++++ >> 4 files changed, 280 insertions(+), 3 deletions(-) > [..] >> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c >> index af2cbab14497..2e424c911049 100644 >> --- a/fs/resctrl/rdtgroup.c >> +++ b/fs/resctrl/rdtgroup.c > [..] >> @@ -2067,6 +2236,16 @@ static struct rftype res_common_files[] = { >> .seq_show = rdtgroup_tasks_show, >> .fflags = RFTYPE_BASE, >> }, >> +#ifdef CONFIG_ARCH_HAS_RESCTRL_DEVICES >> + { >> + .name = "devices", >> + .mode = 0644, >> + .kf_ops = &rdtgroup_kf_single_ops, >> + .write = rdtgroup_devices_write, >> + .seq_show = rdtgroup_devices_show, >> + .fflags = RFTYPE_BASE, > > Once CONFIG_ARCH_HAS_RESCTRL_DEVICES is built in, the file shows up in > every resctrl group directory, even on hardware whose IOMMU does not > implement QOSID. I think it would be better to make fflags zero so > rdtgroup_add_files() skips it, and enable it at runtime from > resctrl_init(). > > Thanks, > Drew Good point. The build-time architecture capability is not sufficient to expose the file. I will look for an appropriate runtime mechanism to control whether the file is exposed. Thank you for the careful review. I really appreciate it. Thanks, Zhanpeng