Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753524AbdI0PPt (ORCPT ); Wed, 27 Sep 2017 11:15:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46646 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907AbdI0PPq (ORCPT ); Wed, 27 Sep 2017 11:15:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EE0636E774 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=oleg@redhat.com Date: Wed, 27 Sep 2017 17:15:42 +0200 From: Oleg Nesterov To: Gargi Sharma Cc: Rik van Riel , linux-kernel@vger.kernel.org, Julia Lawall , akpm@linux-foundation.org, mingo@kernel.org, pasha.tatashin@oracle.com, ktkhai@virtuozzo.com Subject: Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API Message-ID: <20170927151541.GA2429@redhat.com> References: <1506517794.21121.93.camel@surriel.com> <20170927140658.GA28133@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 27 Sep 2017 15:15:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 524 Lines: 20 On 09/27, Gargi Sharma wrote: > > > > > And make this patch correct ;) > > > > because currently it is wrong, zap_pid_ns_processes() won't kill the pid > > returned by the first idr_get_next(). > Yes, I missed this. I can simply remove the idr_get_next() before the > idr_for_each_continue and that will take care of it. Yes, and also remove the while(pid) loop as Rik suggests, just do read_lock(&tasklist_lock); nr = 2; idr_for_each_entry_continue(..., nr) { kill pid_task() } read_unlock(&tasklist_lock); Oleg.