Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964861AbdIYNKC (ORCPT ); Mon, 25 Sep 2017 09:10:02 -0400 Received: from shelob.surriel.com ([96.67.55.147]:51298 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964816AbdIYNKA (ORCPT ); Mon, 25 Sep 2017 09:10:00 -0400 Message-ID: <1506344991.21121.78.camel@surriel.com> Subject: Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API 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:09:51 -0400 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-19LcQeBROUJ8+n/qlTQW" 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: 2154 Lines: 63 --=-19LcQeBROUJ8+n/qlTQW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2017-09-25 at 08:56 -0400, Gargi Sharma 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. Nice work, Gargi! > Signed-off-by: Gargi Sharma > --- a/arch/powerpc/platforms/cell/spufs/sched.c > +++ b/arch/powerpc/platforms/cell/spufs/sched.c > @@ -1093,7 +1093,7 @@ static int show_spu_loadavg(struct seq_file *s, > void *private) > =C2=A0 LOAD_INT(c), LOAD_FRAC(c), > =C2=A0 count_active_contexts(), > =C2=A0 atomic_read(&nr_spu_contexts), > - task_active_pid_ns(current)->last_pid); > + task_active_pid_ns(current)->idr.idr_next-1); > =C2=A0 return 0; > =C2=A0} The repeated use of "idr.idr_next - 1" suggests that maybe this could be hidden behind a new IDR API, but that could be something for a follow-up patch. There already is the idr_get_cursor function, but you would still have to subtract 1 from the value returned by idr_get_cursor... Other than that nitpick, this patch looks good to me. Reviewed-by: Rik van Riel kind regards, Rik van Riel --=20 All Rights Reversed. --=-19LcQeBROUJ8+n/qlTQW 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 iQEcBAABCAAGBQJZyQAfAAoJEM553pKExN6DqyUH/31wP9/f0ZeJfX9SsJO36JNo jpyn/0PIZ/879WOTnpQE7CiJz5H4Iu+MMLcuekcZC23NIdUY067Nr/LPBct6VX13 2ndciQpx6q2dDiuIYuizu+3m3q5dyM0w7AZqrh6AgA1Olz+zSt2W3uC1RLh4sw+J YjPhW4E/zxGk0KzoWJ+/nVrtmTeLNa2X3jA2JiK4Edy5jC6vbNd4zKWkJ2M02s11 cs31hREeT+BkpKnIPWGb+QJGfeeG7iuAdM7Bk9r4V+qjkMkDBAkt0cECG0bavEAP LGbRY3qK9e5LYh6sWVQaZ3QJBtY1b2v40P8dihcpuQ1Fw/0DQcWNukUOLeGk64I= =sbgY -----END PGP SIGNATURE----- --=-19LcQeBROUJ8+n/qlTQW--