[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1931444790.41758556382694.JavaMail.epsvc@epcpadp2new>
Date: Mon, 22 Sep 2025 18:26:54 +0530
From: Neeraj Kumar <s.neeraj@...sung.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: linux-cxl@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-kernel@...r.kernel.org, gost.dev@...sung.com,
a.manzanares@...sung.com, vishak.g@...sung.com, neeraj.kernel@...il.com,
cpgs@...sung.com
Subject: Re: [PATCH V3 04/20] nvdimm/label: Update mutex_lock() with
guard(mutex)()
On 19/09/25 04:55PM, Ira Weiny wrote:
>Neeraj Kumar wrote:
>> Updated mutex_lock() with guard(mutex)()
>
>You are missing the 'why' justification here.
>
>The detail is that __pmem_label_update() is getting more complex and this
>change helps to reduce the complexity later.
>
>However...
>
>[snip]
>
>> @@ -998,9 +998,8 @@ static int init_labels(struct nd_mapping *nd_mapping, int num_labels)
>> label_ent = kzalloc(sizeof(*label_ent), GFP_KERNEL);
>> if (!label_ent)
>> return -ENOMEM;
>> - mutex_lock(&nd_mapping->lock);
>> + guard(mutex)(&nd_mapping->lock);
>> list_add_tail(&label_ent->list, &nd_mapping->labels);
>> - mutex_unlock(&nd_mapping->lock);
>
>... this change is of little value. And...
>
>> }
>>
>> if (ndd->ns_current == -1 || ndd->ns_next == -1)
>> @@ -1039,7 +1038,7 @@ static int del_labels(struct nd_mapping *nd_mapping, uuid_t *uuid)
>> if (!preamble_next(ndd, &nsindex, &free, &nslot))
>> return 0;
>>
>> - mutex_lock(&nd_mapping->lock);
>> + guard(mutex)(&nd_mapping->lock);
>> list_for_each_entry_safe(label_ent, e, &nd_mapping->labels, list) {
>> struct nd_namespace_label *nd_label = label_ent->label;
>>
>> @@ -1061,7 +1060,6 @@ static int del_labels(struct nd_mapping *nd_mapping, uuid_t *uuid)
>> nd_mapping_free_labels(nd_mapping);
>> dev_dbg(ndd->dev, "no more active labels\n");
>> }
>> - mutex_unlock(&nd_mapping->lock);
>
>... this technically changes the scope of the lock to include writing the
>index under the lock.
>
>It does not affect anything AFAICS but really these last two changes
>should be dropped from this patch.
>
>Ira
Sure Ira, I will drop the last two hunks and elaborate commit message.
Regards,
Neeraj
Powered by blists - more mailing lists