Re: [PATCH] pid: cosmetic changes to alloc_pid()

From: Pavel Tikhomirov

Date: Fri Mar 13 2026 - 08:06:36 EST




On 3/7/26 13:11, Oleg Nesterov wrote:
> On 03/07, Mateusz Guzik wrote:
>>
>> On Sat, Mar 7, 2026 at 10:23 AM Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>>>
>>> On 03/06, Mateusz Guzik wrote:
>>>>
>>>> Commit 6d864a1b182532e7 ("pid: only take pidmap_lock once on alloc")
>>>> landed v2 of the patch instead of v3. This patch remedies the problem.
>>>>
>>>> No functional changes.
>>>>
>>>> Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
>>>
>>> The patch looks obviously good, but it conflicts with Pavel's
>>>
>>> [PATCH v4 0/4] pid_namespace: make init creation more flexible
>>> https://lore.kernel.org/all/20260225133229.550302-1-ptikhomirov@xxxxxxxxxxxxx/#t
>>>
>>> In particular, this change:
>>>
>>> - for (tmp = ns, i = ns->level; i >= 0; i--) {
>>> + for (tmp = ns, i = ns->level; i >= 0;) {
>>>
>>> With 2/4 from Pavel we need to decrement "i" before the ->child_reaper
>>> check.
>>>
>>
>> That patch will be fine as it modifies the other loop which already
>> had i-- towards the end.
>>
>> So I don't think there is any need to rebase.
>
> Indeed, I misread your patch, sorry for noise.

I looked into this patch and also confirm that there is no conflict, with my series. And in general patch looks good:

Reviewed-by: Pavel Tikhomirov <ptikhomirov@xxxxxxxxxxxxx>

side note: I've sent v5 of my series, since I found one more place to add READ_ONCE, also based it on top of mm tree. https://lore.kernel.org/all/20260313111014.2068913-1-ptikhomirov@xxxxxxxxxxxxx/

>
> Oleg.
>

--
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.