From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbbCIDjx (ORCPT ); Sun, 8 Mar 2015 23:39:53 -0400 Received: from mail-qc0-f179.google.com ([209.85.216.179]:43134 "EHLO mail-qc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbbCIDjv (ORCPT ); Sun, 8 Mar 2015 23:39:51 -0400 Date: Sun, 8 Mar 2015 23:39:46 -0400 From: Tejun Heo To: Aleksa Sarai Cc: lizefan@huawei.com, mingo@redhat.com, peterz@infradead.org, richard@nod.at, fweisbec@gmail.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v4 2/2] cgroups: add a pids subsystem Message-ID: <20150309033946.GG13283@htj.duckdns.org> References: <1424660891-12719-1-git-send-email-cyphar@cyphar.com> <1425606357-6337-1-git-send-email-cyphar@cyphar.com> <1425606357-6337-3-git-send-email-cyphar@cyphar.com> <20150309033405.GE13283@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150309033405.GE13283@htj.duckdns.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 08, 2015 at 11:34:05PM -0400, Tejun Heo wrote: > > + for (p = pids; p; p = p->parent) { > > + long new; > > + > > + new = atomic_long_add_return(num, &p->counter); > > + > > + if (p->limit == PIDS_UNLIMITED) > > + continue; > > Huh? So, the counter stays out of sync if unlimited? What happens > when it gets set to something else later? Oops, I misread the code, but why is PIDS_UNLIMITED a special case? Just make it a number which always makes the condition true? Thanks. -- tejun