Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757136Ab2FZFYQ (ORCPT ); Tue, 26 Jun 2012 01:24:16 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:45150 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755312Ab2FZFYC (ORCPT ); Tue, 26 Jun 2012 01:24:02 -0400 Date: Mon, 25 Jun 2012 22:23:59 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton cc: Glauber Costa , Tejun Heo , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Frederic Weisbecker , Pekka Enberg , Michal Hocko , Johannes Weiner , Christoph Lameter , devel@openvz.org, kamezawa.hiroyu@jp.fujitsu.com, Pekka Enberg , Suleiman Souhlal Subject: Re: [PATCH 09/11] memcg: propagate kmem limiting information to children In-Reply-To: <20120625162158.cde295bf.akpm@linux-foundation.org> Message-ID: References: <1340633728-12785-1-git-send-email-glommer@parallels.com> <1340633728-12785-10-git-send-email-glommer@parallels.com> <20120625182907.GF3869@google.com> <4FE8E7EB.2020804@parallels.com> <20120625162158.cde295bf.akpm@linux-foundation.org> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1400 Lines: 34 On Mon, 25 Jun 2012, Andrew Morton wrote: > > >> */ > > >> bool use_hierarchy; > > >> - bool kmem_accounted; > > >> + /* > > >> + * bit0: accounted by this cgroup > > >> + * bit1: accounted by a parent. > > >> + */ > > >> + volatile unsigned long kmem_accounted; > > > > > > Is the volatile declaration really necessary? Why is it necessary? > > > Why no comment explaining it? > > > > Seems to be required by set_bit and friends. gcc will complain if it is > > not volatile (take a look at the bit function headers) > > That would be a broken gcc. We run test_bit()/set_bit() and friends > against plain old `unsigned long' in thousands of places. There's > nothing special about this one! > No version of gcc would complain about this, even with 4.6 and later with -fstrict-volatile-bitfields, it's a qualifier that determines whether or not the access to memory is the exact size of the bitfield and aligned to its natural boundary. If the type isn't qualified as such then it's simply going to compile to access the native word size of the architecture. No special consideration is needed for a member of struct mem_cgroup. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/