From nobody Mon Apr 6 09:13:58 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 AA02F379993 for ; Fri, 20 Mar 2026 22:04:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774044244; cv=none; b=DXfEIr8TKfkxzXDKlAluy8uWCbdc10S90ol8/N8pBLyXfnsEv5SMlAQffbwUYFVUaAvW5tTNnmwhLvM10mDyWX+ZjR6l0BhJWd6SZsFn6DycW8ZGilkGaUGgrgZthtO9sa4z6fFpi+8gQh9/hxSGlbyUX2L3cZeXbdhepy2I7Ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774044244; c=relaxed/simple; bh=G7LPBZHxkhwz1Ab4y/GDTNOvOY8/Q8W21Xbce4QcpJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oh4IcxVJjGWUyVBjY7gYWpwH28jFTYgsOWDda5ZuWLWDxD0cQHWaWZnB38KB5FbhuhCVQZz4F0bfiMK3DrG1O+qZ2t4Y4vdyhBLtB+ngB7I+HK1nc8TTf8cBAVnDQGtmGH4JxXUYXLz2mdDk9Adf5G4rQsZ5tXrjn1VgGc0hyQo= 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=K1sq+UFa; arc=none smtp.client-ip=198.175.65.9 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="K1sq+UFa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774044242; x=1805580242; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G7LPBZHxkhwz1Ab4y/GDTNOvOY8/Q8W21Xbce4QcpJg=; b=K1sq+UFaKbG6KvyWjXloGrS0EdQC6Y/XIbwwWSjrKTakUtssLz+G4Zyp K4duuonnG7gwsaGsY08TMbrZ8JcBxYC1YrLc+s2VFj7i3rE8IWI78m+q0 8tHtfl9UhJp8R/9ecA/xEoaE/FdchhUt4+2XzDvNL+EjZw2hOxaWrf9On XbzQ2g1CMPkvowVbujJ0ydrUQHu4v/d9g/Asdrho4L4H92OIfI1RqMamF urHb+MgHTXbsPetAdksiOTKUowiwewT2/DLs8Wg71BCAy/Eus5rBO+ml5 vJ7LTwfr0OJ/cvx9EEx1ESqUHXGplJWePZAzSPf0hZ1Y9coyban4cEHbH A==; X-CSE-ConnectionGUID: KojIrGQcT4GGxRwaloY13Q== X-CSE-MsgGUID: x12RactaSKOzXEOMMWWhVg== X-IronPort-AV: E=McAfee;i="6800,10657,11735"; a="97758418" X-IronPort-AV: E=Sophos;i="6.23,132,1770624000"; d="scan'208";a="97758418" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2026 15:03:56 -0700 X-CSE-ConnectionGUID: Qq9mNdA1Rq2BQjwHemtKfQ== X-CSE-MsgGUID: cwEdzKXpTOGCJBdgRbziOw== X-ExtLoop1: 1 Received: from rchatre-desk1.jf.intel.com ([10.165.154.99]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2026 15:03:56 -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 v2 09/14] fs/resctrl: Add last_cmd_status support for writes to max_threshold_occupancy Date: Fri, 20 Mar 2026 15:03:19 -0700 Message-ID: <1477243b7c470baa920d94477b30d41405fce45c.1774043709.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 Reviewed-by: Ben Horgan --- Changes since v1: - Add Ben's RB tag. --- fs/resctrl/rdtgroup.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 111bff8e33fd..6fa5c8f14e3a 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -1238,16 +1238,27 @@ static ssize_t max_threshold_occ_write(struct kernf= s_open_file *of, unsigned int bytes; int ret; =20 + mutex_lock(&rdtgroup_mutex); + rdt_last_cmd_clear(); + ret =3D kstrtouint(buf, 0, &bytes); - if (ret) - return ret; + if (ret) { + rdt_last_cmd_puts("Invalid input\n"); + goto out_unlock; + } =20 - if (bytes > resctrl_rmid_realloc_limit) - return -EINVAL; + if (bytes > resctrl_rmid_realloc_limit) { + rdt_last_cmd_printf("Exceeds limit (before adjustment) of %u bytes\n", + resctrl_rmid_realloc_limit); + ret =3D -EINVAL; + goto out_unlock; + } =20 resctrl_rmid_realloc_threshold =3D resctrl_arch_round_mon_val(bytes); =20 - return nbytes; +out_unlock: + mutex_unlock(&rdtgroup_mutex); + return ret ?: nbytes; } =20 /* --=20 2.50.1