From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751027AbdJAJPZ (ORCPT ); Sun, 1 Oct 2017 05:15:25 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38017 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbdJAJPY (ORCPT ); Sun, 1 Oct 2017 05:15:24 -0400 Date: Sun, 1 Oct 2017 02:15:20 -0700 From: Christoph Hellwig To: Gargi Sharma Cc: linux-kernel@vger.kernel.org, riel@surriel.com, julia.lawall@lip6.fr, akpm@linux-foundation.org, mingo@kernel.org, pasha.tatashin@oracle.com, ktkhai@virtuozzo.com, oleg@redhat.com Subject: Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API Message-ID: <20171001091520.GA21161@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - task_active_pid_ns(current)->last_pid); > + task_active_pid_ns(current)->idr.idr_next-1); I think we want a well documented helper for this pattern instead of poking into the internals. Also is last - 1 always the correct answer? Even with idr_alloc_cyclic we could wrap around, couldn't we?