From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753007AbbC0MDF (ORCPT ); Fri, 27 Mar 2015 08:03:05 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:42256 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753003AbbC0MDD (ORCPT ); Fri, 27 Mar 2015 08:03:03 -0400 Date: Fri, 27 Mar 2015 13:02:40 +0100 From: Peter Zijlstra To: Christoph Lameter Cc: Viresh Kumar , Andrew Morton , hannes@cmpxchg.org, Linaro Kernel Mailman List , Linux Kernel Mailing List , vinmenon@codeaurora.org, shashim@codeaurora.org, Michal Hocko , mgorman@suse.de, dave@stgolabs.net, koct9i@gmail.com, Linux Memory Management List , Suresh Siddha , Thomas Gleixner Subject: Re: [RFC] vmstat: Avoid waking up idle-cpu to service shepherd work Message-ID: <20150327120240.GC23123@twins.programming.kicks-ass.net> References: <359c926bc85cdf79650e39f2344c2083002545bb.1427347966.git.viresh.kumar@linaro.org> <20150326131822.fce6609efdd85b89ceb3f61c@linux-foundation.org> <20150327091613.GE27490@worktop.programming.kicks-ass.net> <20150327093023.GA32047@worktop.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 27, 2015 at 06:11:44AM -0500, Christoph Lameter wrote: > On Fri, 27 Mar 2015, Peter Zijlstra wrote: > > > > We could align the base on 8 bytes to gain an extra bit in the pointer > > > and use that bit to indicate the running state. Then these sites can > > > spin on that bit while we can change the actual base pointer. > > > > Even though tvec_base has ____cacheline_aligned stuck on, most are > > allocated using kzalloc_node() which does not actually respect that but > > already guarantees a minimum u64 alignment, so I think we can use that > > third bit without too much magic. > > Create a new slab cache for this purpose that does the proper aligning? That is certainly a possibility, but we'll only ever allocate nr_cpus-1 entries from it, a whole new slab cache might be overkill. What's not clear to me is why that thing is allocated at all, AFAICT something like: static DEFINE_PER_CPU(struct tvec_base, tvec_bases); Should do the right thing and be much simpler.