From nobody Tue Mar 3 05:11:12 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 D6E13377034 for ; Mon, 2 Mar 2026 18:46:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772477194; cv=none; b=pbrgFu/O9EFkGcW8d6yZ8jFm7znowEwHVlrNQ7T+XQ0gMGZsV57Ah3M85BgxvNYGsJ7OUI0JjVIaq00AvhPu0RtcBjHtbEr9B7x9WH9FImou/Ra1HRVtl7tHhUkC9oVzzVCSkbHgSN1KMUv2gmxae4G4guqqcI9EKbPNsv+tJhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772477194; c=relaxed/simple; bh=Qq52SRm9YMpEcB4HrMywHjfc+PUC4Z32uOPEJC9WLiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NAH3K5pAmG9uY26y3YBB4u5wiOCymnkGqvG1SMZ7/9SrIGeO46Z5X88Sj+7YRfJfmivxitLoCHkIc/tlY7RJd0BXh+qcdQvFuxm0yTrKXJYuSP9ZW1e0tm7KpR3GDHQHHAblQoTfF97/U0Kc9kQo01zmgpulYEI5jr5nnKCthqM= 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=cZlW+bBm; arc=none smtp.client-ip=192.198.163.11 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="cZlW+bBm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1772477192; x=1804013192; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qq52SRm9YMpEcB4HrMywHjfc+PUC4Z32uOPEJC9WLiA=; b=cZlW+bBm2zg0Y6818LSLsjkl1QJ329Tw0vivpCEf9ElBYxDCcQih/WYm Mf0lCmhfPWby1C2swGbcH8hzsLDspFO+BossW1zWuywe6HO7aFdVStwBW DU5u9PpHP5kj4LKluAeEimjXvVe+Ll9PRjrLnVa0jKBge+oIAOd3KXYnA ciNYSwRKxTi81X+bo2QgVx6VtzkiWnfg5ljAzwMYKVdNB7B/HgbZYjqtS 7er8xBztxo7sgwzcDBhgjeAch//QjBawl5irTLQ5dt6dn1hCYTvEcE8g8 v+zL6+bK0iRtHR3TQLixmaLEXi5Qae9nFbTI0BUsNYKt3MCg/v5fWK5cw Q==; X-CSE-ConnectionGUID: dngXnuSnSbi/C9Mii/4SBg== X-CSE-MsgGUID: 9/Su64jzSHSEfYb0XaxVFA== X-IronPort-AV: E=McAfee;i="6800,10657,11717"; a="84135490" X-IronPort-AV: E=Sophos;i="6.21,320,1763452800"; d="scan'208";a="84135490" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2026 10:46:26 -0800 X-CSE-ConnectionGUID: W/NkPF9qTqq5HXxRFtBljQ== X-CSE-MsgGUID: 7XiSeI0aS4+rwi8TTKctNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,320,1763452800"; d="scan'208";a="255604095" Received: from rchatre-desk1.jf.intel.com ([10.165.154.99]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2026 10:46:26 -0800 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 07/11] fs/resctrl: Add last_cmd_status support for writes to max_threshold_occupancy Date: Mon, 2 Mar 2026 10:46:13 -0800 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" 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 --- 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 3c9508fc558d..933f6ae26d59 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