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

From: Andrew Morton
Date: Wed Oct 11 2017 - 18:37:35 EST


On Wed, 11 Oct 2017 18:19:38 -0400 Gargi Sharma <gs051095@xxxxxxxxx> wrote:

> This patch replaces the current bitmap implemetation for
> Process ID allocation. Functions that are no longer required,
> for example, free_pidmap(), alloc_pidmap(), etc. are removed.
> The rest of the functions are modified to use the IDR API.
> The change was made to make the PID allocation less complex by
> replacing custom code with calls to generic API.

I still don't understand the locking. spin_lock_irq(&pidmap_lock) in
some places, rcu_read_lock() in others.

If the locking is indeed now correct, can we please get it fully
documented? A comment at the pid_namespace.idr definition site would
suit.