From: Rik van Riel <riel@surriel.com>
To: Gargi Sharma <gs051095@gmail.com>
Cc: linux-kernel@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>,
akpm@linux-foundation.org, mingo@kernel.org,
pasha.tatashin@oracle.com, ktkhai@virtuozzo.com,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH 3/4] pid.c: Replace pidhash lookup with idr_get()
Date: Mon, 25 Sep 2017 15:30:47 -0400 [thread overview]
Message-ID: <1506367847.21121.85.camel@surriel.com> (raw)
In-Reply-To: <CAOCi2DEpJ+dP7pTnkixjsR8mAjgDA4NPjj8z9RQjax1z-3b6UA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1836 bytes --]
On Mon, 2017-09-25 at 23:14 +0530, Gargi Sharma wrote:
> On Mon, Sep 25, 2017 at 6:50 PM, Rik van Riel <riel@surriel.com>
> wrote:
> > On Mon, 2017-09-25 at 08:56 -0400, Gargi Sharma wrote:
> > > pidhash is no longer required as all the functionalities
> > > are present in the idr tree associated with the namespace.
> > > nr can be looked up in the namespace by idr_get().
> > >
> > > Signed-off-by: Gargi Sharma <gs051095@gmail.com>
> > > ---
> > > kernel/pid.c | 10 +---------
> > > 1 file changed, 1 insertion(+), 9 deletions(-)
> > >
> > > diff --git a/kernel/pid.c b/kernel/pid.c
> > > index ea22e89..761a0c2 100644
> > > --- a/kernel/pid.c
> > > +++ b/kernel/pid.c
> > > @@ -247,15 +247,7 @@ void disable_pid_allocation(struct
> > > pid_namespace
> > > *ns)
> > >
> > > struct pid *find_pid_ns(int nr, struct pid_namespace *ns)
> > > {
> > > - struct upid *pnr;
> > > -
> > > - hlist_for_each_entry_rcu(pnr,
> > > - &pid_hash[pid_hashfn(nr, ns)], pid_chain)
> > > - if (pnr->nr == nr && pnr->ns == ns)
> > > - return container_of(pnr, struct pid,
> > > - numbers[ns->level]);
> > > -
> > > - return NULL;
> > > + return idr_get(&ns->idr, &nr);
> > > }
> > > EXPORT_SYMBOL_GPL(find_pid_ns);
> >
> > Does this work if you call idr_find instead of idr_get?
> >
> > Then patch 2/4 would not be needed.
>
> Yes, patch 2/4 can be dropped. I think this patch can be merged with
> patch 4/4 where I remove pidhash, since this function is more or less
> aimed at that too?
Yes, that would simplify your patch series a little bit.
--
All Rights Reversed.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2017-09-25 19:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 12:56 [PATCH 0/4] Replace PID bitmap with IDR API implementation Gargi Sharma
2017-09-25 12:56 ` [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API Gargi Sharma
2017-09-25 13:09 ` Rik van Riel
2017-09-25 14:59 ` Oleg Nesterov
2017-09-25 17:41 ` Gargi Sharma
2017-09-25 15:20 ` Oleg Nesterov
2017-09-25 17:41 ` Gargi Sharma
2017-09-25 12:56 ` [PATCH 2/4] idr: Add a function idr_get() Gargi Sharma
2017-09-25 13:20 ` Rik van Riel
2017-09-25 13:47 ` Christoph Hellwig
2017-09-25 14:12 ` Oleg Nesterov
2017-09-25 17:43 ` Gargi Sharma
2017-09-25 12:56 ` [PATCH 3/4] pid.c: Replace pidhash lookup with idr_get() Gargi Sharma
2017-09-25 13:20 ` Rik van Riel
2017-09-25 17:44 ` Gargi Sharma
2017-09-25 19:30 ` Rik van Riel [this message]
2017-09-25 12:56 ` [PATCH 4/4] pid: Remove pidhash Gargi Sharma
2017-09-25 13:48 ` Rik van Riel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1506367847.21121.85.camel@surriel.com \
--to=riel@surriel.com \
--cc=akpm@linux-foundation.org \
--cc=gs051095@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=pasha.tatashin@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox