Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965943AbdIYTlY (ORCPT ); Mon, 25 Sep 2017 15:41:24 -0400 Received: from shelob.surriel.com ([96.67.55.147]:52444 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965176AbdIYTlW (ORCPT ); Mon, 25 Sep 2017 15:41:22 -0400 Message-ID: <1506367847.21121.85.camel@surriel.com> Subject: Re: [PATCH 3/4] pid.c: Replace pidhash lookup with idr_get() From: Rik van Riel To: Gargi Sharma Cc: linux-kernel@vger.kernel.org, Julia Lawall , akpm@linux-foundation.org, mingo@kernel.org, pasha.tatashin@oracle.com, ktkhai@virtuozzo.com, Oleg Nesterov Date: Mon, 25 Sep 2017 15:30:47 -0400 In-Reply-To: References: <1506345653.21121.82.camel@surriel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-sFSAZ/tiXKbLbHlWPV9M" X-Mailer: Evolution 3.22.6 (3.22.6-2.fc25) Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3095 Lines: 79 --=-sFSAZ/tiXKbLbHlWPV9M Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2017-09-25 at 23:14 +0530, Gargi Sharma wrote: > On Mon, Sep 25, 2017 at 6:50 PM, Rik van Riel > 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(). > > >=20 > > > Signed-off-by: Gargi Sharma > > > --- > > > =C2=A0kernel/pid.c | 10 +--------- > > > =C2=A01 file changed, 1 insertion(+), 9 deletions(-) > > >=20 > > > 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) > > >=20 > > > =C2=A0struct pid *find_pid_ns(int nr, struct pid_namespace *ns) > > > =C2=A0{ > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct upid *pnr; > > > - > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hlist_for_each_entry_rcu(pnr, > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0&pid_hash[pid_h= ashfn(nr, ns)], pid_chain) > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0if (pnr->nr =3D=3D nr && pnr->ns =3D=3D ns) > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return containe= r_of(pnr, struct pid, > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0numbers[ns->level]); > > > - > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return NULL; > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return idr_get(&ns->idr, &nr); > > > =C2=A0} > > > =C2=A0EXPORT_SYMBOL_GPL(find_pid_ns); > >=20 > > Does this work if you call idr_find instead of idr_get? > >=20 > > Then patch 2/4 would not be needed. >=20 > 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. --=20 All Rights Reversed. --=-sFSAZ/tiXKbLbHlWPV9M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJZyVlnAAoJEM553pKExN6DCG0H/A6gzaosf8J042C0BHkYtV7D LOZs7r/00AEs2lwTZ54Hkb5vWe9grXMbdC8T+NxfSEh936sZk7F/t/cJNbuAFRs6 Dt9THc7RtkT1sdMEqZNWI/ZWX7aFpAev/VhzSvmiO9d3H9jwy0IspuBsLxM44kPQ Z4vj3g03K+6bGnAVVus1qcWu8K8iUHswDZmx7+rUJewGirX4ii2ugHhDxrj/zdCj xL6BfdGCIrH+Zc32GhQnBHy/h5pjsRhyHjqIwB4/40LkZvIx19N+Jl96+0Q0+xuS SdnHEL9dX6XR+LMmzJa0MaeUh7g/VUvnQ9U7VW+dqeq6xuHYjIB5+cYNiwNFsN4= =E39T -----END PGP SIGNATURE----- --=-sFSAZ/tiXKbLbHlWPV9M--