Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934656AbdIYNU4 (ORCPT ); Mon, 25 Sep 2017 09:20:56 -0400 Received: from shelob.surriel.com ([96.67.55.147]:51387 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932107AbdIYNUy (ORCPT ); Mon, 25 Sep 2017 09:20:54 -0400 Message-ID: <1506345653.21121.82.camel@surriel.com> Subject: Re: [PATCH 3/4] pid.c: Replace pidhash lookup with idr_get() From: Rik van Riel To: Gargi Sharma , linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr, akpm@linux-foundation.org, mingo@kernel.org, pasha.tatashin@oracle.com, ktkhai@virtuozzo.com, oleg@redhat.com Date: Mon, 25 Sep 2017 09:20:53 -0400 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-HHJWsVQIBWIYz5l/b90t" 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: 1920 Lines: 61 --=-HHJWsVQIBWIYz5l/b90t Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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) > =C2=A0 > =C2=A0struct pid *find_pid_ns(int nr, struct pid_namespace *ns) > =C2=A0{ > - struct upid *pnr; > - > - hlist_for_each_entry_rcu(pnr, > - &pid_hash[pid_hashfn(nr, ns)], pid_chain) > - if (pnr->nr =3D=3D nr && pnr->ns =3D=3D ns) > - return container_of(pnr, struct pid, > - numbers[ns->level]); > - > - return NULL; > + return idr_get(&ns->idr, &nr); > =C2=A0} > =C2=A0EXPORT_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. --=20 All Rights Reversed. --=-HHJWsVQIBWIYz5l/b90t 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 iQEcBAABCAAGBQJZyQK1AAoJEM553pKExN6DHYkIAKfJkqF2TuHepG3bl0Dotdz5 qe9oCoyWp6GMSwhx7hZ59KM7HXjnFV0eWGejaixL9tc5ptWkHkBiObSUSwLkZpZk 6auR/damVFxvgkGJ2HBhIMuZjciQMulL8VDv9YmfSr20a05zkiRoYg+XH8YeXXfa fSpzMoX+9Y5GIcS4WQz23fmtb9q+ThI0TustQmkJxwDiWQkh3vSQ7lmt1/ROvUUS uJmKz50thKAucoVXXHOjrL55xfwtbemqfmPH28xlUz7fzHLyFPFifl0lgHg2upv/ Em2FXBN/bI2/2h6jq/eEA1R2OgYulE0gQc+sU0xf5HWL88AMilKSut3mb6ALOnQ= =GYHD -----END PGP SIGNATURE----- --=-HHJWsVQIBWIYz5l/b90t--