lkml.org 
[lkml]   [2017]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API
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 ?

Oleg.

\
 
 \ /
  Last update: 2017-09-25 17:22    [W:0.139 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site