Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936353AbdIYRmX (ORCPT ); Mon, 25 Sep 2017 13:42:23 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:36161 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934132AbdIYRmV (ORCPT ); Mon, 25 Sep 2017 13:42:21 -0400 X-Google-Smtp-Source: AOwi7QBgnP8LPyeQk+e/Udzz6y/3OZWI4HT4EotUzlrwm3HTPsHEy9fOwiQ2B83C7f/IlrhCg5nQbPpHcNvG6oZSCxY= MIME-Version: 1.0 In-Reply-To: <20170925152027.GA12957@redhat.com> References: <20170925152027.GA12957@redhat.com> From: Gargi Sharma Date: Mon, 25 Sep 2017 23:11:49 +0530 Message-ID: Subject: Re: [PATCH 1/4] pid: Replace pid bitmap implementation with IDR API To: Oleg Nesterov Cc: linux-kernel@vger.kernel.org, Rik van Riel , Julia Lawall , akpm@linux-foundation.org, mingo@kernel.org, pasha.tatashin@oracle.com, ktkhai@virtuozzo.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 949 Lines: 34 On Mon, Sep 25, 2017 at 8:50 PM, Oleg Nesterov wrote: > On 09/25, Gargi Sharma wrote: >> >> @@ -285,10 +145,14 @@ void free_pid(struct pid *pid) >> break; >> } >> } >> - spin_unlock_irqrestore(&pidmap_lock, flags); >> >> - for (i = 0; i <= pid->level; i++) >> - free_pidmap(pid->numbers + i); >> + for (i = 0; i <= pid->level; i++) { >> + struct upid *upid = pid->numbers + i; >> + struct pid_namespace *ns = upid->ns; >> + >> + idr_remove(&ns->idr, upid->nr); >> + } >> + spin_unlock_irqrestore(&pidmap_lock, flags); > > Now that you moved the "free pidmap" code under pidmap_lock, we do not > need 2 "for (i = 0; i <= pid->level; i++)" loops, you could simply add > a single > > idr_remove(&ns->idr, upid->nr); > > line into the 1st loop ? Yes, I can do that. Will make this change. Thanks! Gargi > > Oleg. >