Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1739195

Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API

From Gargi Sharma <gs051095@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API
Date 2017-09-25 19:50 +0200
Message-ID <utFG1-198-13@gated-at.bofh.it> (permalink)
References <utB9n-6tv-9@gated-at.bofh.it> <utB9o-6tv-17@gated-at.bofh.it> <utDuy-8b2-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Sep 25, 2017 at 8:50 PM, Oleg Nesterov <oleg@redhat.com> wrote:
> On 09/25, Gargi Sharma wrote:
>>
>> @@ -285,10 +145,14 @@ void free_pid(struct pid *pid)
>>                       break;
>>               }
>>       }
>> -     spin_unlock_irqrestore(&pidmap_lock, flags);
>>
>> -     for (i = 0; i <= pid->level; i++)
>> -             free_pidmap(pid->numbers + i);
>> +     for (i = 0; i <= pid->level; i++) {
>> +             struct upid *upid = pid->numbers + i;
>> +             struct pid_namespace *ns = upid->ns;
>> +
>> +             idr_remove(&ns->idr, upid->nr);
>> +     }
>> +     spin_unlock_irqrestore(&pidmap_lock, flags);
>
> Now that you moved the "free pidmap" code under pidmap_lock, we do not
> need 2 "for (i = 0; i <= pid->level; i++)" loops, you could simply add
> a single
>
>         idr_remove(&ns->idr, upid->nr);
>
> line into the 1st loop ?

Yes, I can do that. Will make this change.

Thanks!
Gargi
>
> Oleg.
>

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] pid: Replace pid bitmap implementation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-25 15:00 +0200
  Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API Rik van Riel <riel@surriel.com> - 2017-09-25 15:20 +0200
  Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API Oleg Nesterov <oleg@redhat.com> - 2017-09-25 17:00 +0200
    Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-25 19:50 +0200
  Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API Oleg Nesterov <oleg@redhat.com> - 2017-09-25 17:30 +0200
    Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-25 19:50 +0200

csiph-web