[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170925152027.GA12957@redhat.com>
Date: Mon, 25 Sep 2017 17:20:27 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Gargi Sharma <gs051095@...il.com>
Cc: linux-kernel@...r.kernel.org, riel@...riel.com,
julia.lawall@...6.fr, akpm@...ux-foundation.org, mingo@...nel.org,
pasha.tatashin@...cle.com, ktkhai@...tuozzo.com
Subject: Re: [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.
Powered by blists - more mailing lists