From nobody Thu Apr 9 15:03:42 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 A867B213254 for ; Tue, 7 Apr 2026 16:02:50 +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=1775577778; cv=none; b=ZFbLEcvM2i4NQ+TPCGMNx1uDUQJv/EIZKF9BvcxwR8c05DstK2miOh3GFrsYCx8qydxrYxHIXsmHQAvLywsT7CLcYuiPBSFe4GHbNyfDFXux+N2ZNB9dCj0HIg0+e9jQQP73rKuqtWgUK+O/8mckofGv6IsBBBSmogxw8RgS7TE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775577778; c=relaxed/simple; bh=/aVegcj2Gd/PPwuq0w7v0DVXLWgC36AnHuP/93CopIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SDP6nyqKV1TtxdfiThSV3ydwWdsZXrrr/3HJq4oueDTLu8kt5Fn5mVvyVqVr7wjqrOVfCYmOog/ZKkvDP1Bct1mH7QFVenFdSvsalVw3cj3MzPNKv4YbSt7FlaSy53DQKEZoAR8xh9MTV3aU8PAiDDb/2EuvnGSl6oVWpnr1s0U= 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=Y3veEfH6; 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="Y3veEfH6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775577770; x=1807113770; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/aVegcj2Gd/PPwuq0w7v0DVXLWgC36AnHuP/93CopIQ=; b=Y3veEfH6BfpPZbq9BcuFckxTuAuTdJQFhXJVJUYle00WazUCjv7Mf1Rf NJR8kcXQS3WMH4GgvVY43Nnpb8B9Ko8ecllVh9xgdaJ13JeU7yaMZtfZO EcG5pv69TcZM8lNVrXWGAPZmPa6zamYmqjaB77TiD3nGDDHlEvqKCvP5s avdS0ldibjjI71FY3R35A6p5t5bTyesYZrI7wE8lVIdfnQ7DYOKN5/t+f q2elMCcFaSxNPaynh0ACU/zNk9sFppxJpBWrhuZ/gROGuReU8UsnS8pK2 aFJze0ERqY/RpI/MKgEshf0f8Jc67EY5PzOsQLtv6n1ue8C71qhVUhpDo A==; X-CSE-ConnectionGUID: b46LJf2eTtqPIsYTy6t24A== X-CSE-MsgGUID: ri7TfywVR+GF7ytrqeY1PQ== X-IronPort-AV: E=McAfee;i="6800,10657,11752"; a="80432700" X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="80432700" 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: /8YAnnejSAaDG/xdgl374A== X-CSE-MsgGUID: tiC2GrJBRM2uvnQt2g6P5g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="228119056" 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 09/13] fs/resctrl: Add last_cmd_status support for writes to max_threshold_occupancy Date: Tue, 7 Apr 2026 09:02:06 -0700 Message-ID: <3a55b9a6ced4d1cfc69894840afa747de592ce5d.1775576382.git.reinette.chatre@intel.com> 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" info/last_cmd_status is intended to contain more information if a write to any resctrl file fails. Writes to max_threshold_occupancy did not receive last_cmd_status support during initial last_cmd_status enabling. Add it now. Signed-off-by: Reinette Chatre --- Changes since v1: - Add Ben's RB tag. Changes since v2: - Switch to guard(). (Chenyu) - Drop Ben's RB tag due to significant code change. --- fs/resctrl/rdtgroup.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 5dfdaa6f9d8f..5e3ea92cc243 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -12,6 +12,7 @@ =20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt =20 +#include #include #include #include @@ -1238,12 +1239,20 @@ static ssize_t max_threshold_occ_write(struct kernf= s_open_file *of, unsigned int bytes; int ret; =20 + guard(mutex)(&rdtgroup_mutex); + rdt_last_cmd_clear(); + ret =3D kstrtouint(buf, 0, &bytes); - if (ret) + if (ret) { + rdt_last_cmd_puts("Invalid input\n"); return ret; + } =20 - if (bytes > resctrl_rmid_realloc_limit) + if (bytes > resctrl_rmid_realloc_limit) { + rdt_last_cmd_printf("Exceeds limit (before adjustment) of %u bytes\n", + resctrl_rmid_realloc_limit); return -EINVAL; + } =20 resctrl_rmid_realloc_threshold =3D resctrl_arch_round_mon_val(bytes); =20 --=20 2.50.1