From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932782AbdERP4r (ORCPT ); Thu, 18 May 2017 11:56:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12832 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932145AbdERP4m (ORCPT ); Thu, 18 May 2017 11:56:42 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CCD0A80C01 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=longman@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CCD0A80C01 Subject: Re: [RFC PATCH v2 09/17] cgroup: Keep accurate count of tasks in each css_set To: Tejun Heo References: <1494855256-12558-1-git-send-email-longman@redhat.com> <1494855256-12558-10-git-send-email-longman@redhat.com> <20170517214034.GF942@htj.duckdns.org> Cc: Li Zefan , Johannes Weiner , Peter Zijlstra , Ingo Molnar , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, kernel-team@fb.com, pjt@google.com, luto@amacapital.net, efault@gmx.de From: Waiman Long Organization: Red Hat Message-ID: Date: Thu, 18 May 2017 11:56:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170517214034.GF942@htj.duckdns.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 18 May 2017 15:56:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/17/2017 05:40 PM, Tejun Heo wrote: > Hello, > > On Mon, May 15, 2017 at 09:34:08AM -0400, Waiman Long wrote: >> The reference count in the css_set data structure was used as a >> proxy of the number of tasks attached to that css_set. However, that >> count is actually not an accurate measure especially with thread mode >> support. So a new variable task_count is added to the css_set to keep >> track of the actual task count. This new variable is protected by >> the css_set_lock. Functions that require the actual task count are >> updated to use the new variable. >> >> Signed-off-by: Waiman Long > Looks good. We probably should replace css_set_populated() to use > this too. > > Thanks. > Yes, you are right. css_set_populated() can be replaced with a check on the task_count. Regards, Longman