From nobody Thu Apr 9 15:00:57 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C22FB3C6A56 for ; Tue, 7 Apr 2026 16:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775577789; cv=none; b=lRVZkY6xXThS99YJ+khASeJgHpb80opn/N/iOFGGRQFhLSBaI7bC0jW9zHnBKO9ISnzqvrfWjUj+6cTrFQmYyZMLbBK1BLcwj1m5ZUGjMBhLEYKJ+Ltq2FfI4UXsAo5MTTOsHIdEde6oyQK13rRDX4wDrIoCLz2+4E4Dcy5DjZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775577789; c=relaxed/simple; bh=kmpz5ziyeYgyjq9BX9vfAEaKU1VXDjgMSNyT/xCR9+Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LltIDGc1wFEg4rOWhDhYCuM8snKmotPdixWJ0k9XTQfLgDEnD1BTLMu4dv6CrNwA9ZJ2PT6ScJAyj2si7PgUYUbibr/h+yOWK+o1PoDXNZ+RaafjyUAhmmNmk4/bbZVqrmlpgaljYqXhNm/bzeCbSPkZt6iEdqcsM01/y55zY3M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jp/nIa/S; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jp/nIa/S" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775577782; x=1807113782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kmpz5ziyeYgyjq9BX9vfAEaKU1VXDjgMSNyT/xCR9+Q=; b=jp/nIa/SWKbE5SAK+HYWpaNCpSnE7bAcq7PYRq032DtiUTXyTRGLsUb4 cZVg+7ZJLAFkqzFBo7n4TKH2Xvo2tFo4YAn4ox2SHhqe1hXeHXRmR8FWa wu+Y4WH+Tn4GiWT64RAto9rVbJfJ711b11Gg3K2Qd8Mkvslf9tDsT+6j/ YjD5BB2O/WfTKRTnG6SvW7J7ZZQ1sOuJDaosD3CN5z8Ll82qj4wwgOcLk BsN3/5ZqyLHoT0MXM4C6Jy5ir6z5sVbMIMKG/vRhfnMiIBzMQFVMb7/kb 3CIkEazlqFM7BNhStCDmf4xP6TvsINd9phpJf/QIIPpHX+LkGBRIShvgx w==; X-CSE-ConnectionGUID: MsEwkjjhT+2SeD93O0reLw== X-CSE-MsgGUID: Qb25CyuFQKyS5MegqQUM/Q== X-IronPort-AV: E=McAfee;i="6800,10657,11752"; a="80432738" X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="80432738" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2026 09:02:19 -0700 X-CSE-ConnectionGUID: Y85Y3FGASnaJsp9BEqyRjA== X-CSE-MsgGUID: eu0ImZeMSqKieK3u8x93bw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="228119069" Received: from rchatre-desk1.jf.intel.com ([10.165.154.99]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2026 09:02:18 -0700 From: Reinette Chatre To: tony.luck@intel.com, james.morse@arm.com, Dave.Martin@arm.com, babu.moger@amd.com, bp@alien8.de, tglx@linutronix.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, ben.horgan@arm.com, fustini@kernel.org, fenghuay@nvidia.com, peternewman@google.com, linux-kernel@vger.kernel.org, patches@lists.linux.dev, reinette.chatre@intel.com Subject: [PATCH v3 13/13] fs/resctrl: Inform user space when status buffer overflowed Date: Tue, 7 Apr 2026 09:02:10 -0700 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" resctrl fs commands are becoming more powerful with, for example, a user able to use syntax like '*' to make broad configuration changes. Such commands that span multiple domains may result in more than one message printed to the last_cmd_status buffer with more planned. Display "[truncated]" to user space when displaying the last_cmd_status buffer to communicate if it overflowed. Upon encountering this user space is expected to combine details about the failure found in info/last_cmd_sta= tus with related resctrl files to learn the accurate system state after the command failure. Signed-off-by: Reinette Chatre Reviewed-by: Ben Horgan --- Changes since v2: - Add Ben's RB tag. --- fs/resctrl/rdtgroup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 0677e6e4102e..5413a625ff32 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -971,10 +971,13 @@ static int rdt_last_cmd_status_show(struct kernfs_ope= n_file *of, =20 mutex_lock(&rdtgroup_mutex); len =3D seq_buf_used(&last_cmd_status); - if (len) + if (len) { seq_printf(seq, "%.*s", len, last_cmd_status_buf); - else + if (seq_buf_has_overflowed(&last_cmd_status)) + seq_puts(seq, "[truncated]\n"); + } else { seq_puts(seq, "ok\n"); + } mutex_unlock(&rdtgroup_mutex); return 0; } --=20 2.50.1