Thread (199 messages) 199 messages, 11 authors, 2025-10-17

Re: [PATCH v2 08/29] arm_mpam: Add the class and component structures for firmware described ris

From: James Morse <james.morse@arm.com>
Date: 2025-09-26 17:52:59
Also in: linux-acpi, lkml

Hi Markus,

On 11/09/2025 17:30, Markus Elfring wrote:
quoted
+++ b/drivers/resctrl/mpam_devices.c
quoted
quoted
+int mpam_ris_create(struct mpam_msc *msc, u8 ris_idx,
+		    enum mpam_class_types type, u8 class_id, int component_id)
+{
+	int err;
+
+	mutex_lock(&mpam_list_lock);
+	err = mpam_ris_create_locked(msc, ris_idx, type, class_id,
+				     component_id);
+	mutex_unlock(&mpam_list_lock);
…

Under which circumstances would you become interested to apply a statement
like “guard(mutex)(&mpam_list_lock);”?
https://elixir.bootlin.com/linux/v6.17-rc5/source/include/linux/mutex.h#L228
None! The bit of this you cut out is a call to mpam_free_garbage() which calls
synchronize_srcu(). That may sleep for a while. The whole point of the deferred free-ing
is it does not happen under the lock. The 'guard' magic means the compiler gets to choose
when to call unlock.



Thanks,

James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help