From patchwork Sun Mar 29 12:01:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 46462 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1515B2159F for ; Sun, 29 Mar 2015 12:01:47 +0000 (UTC) Received: by wibdy1 with SMTP id dy1sf12320633wib.3 for ; Sun, 29 Mar 2015 05:01:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=IhaIZ7IU15V8sBhBjL7JyHV/epNAWTCSwPb5IUx7mSg=; b=UvyOS73sZNBxRVcZVqb4L51RH/LBqwMmMzZsZ2uHUB9OToTyRz04w/1D2BGb/mvyLL fctFkJoRoIpF7P0iLAcLODkEshm22zRxwTdt6tPYlrGYKzhAgeo1rqdW7wusS8NiddPN YYV2698OJNICk06PE7kQa/BfEvIz2KHoIEytxnCgLaBgKEeU9J46IMGnQULfHVR/yshR wV4aNWHv+mpA+PWG95helH2tFO1EfoouqG8bA0qbdn39bntFfzenPAHq+IlAVdDd8UPU Joc5Zng6sHsb70BYFAfti3RxCt4XwwPFURfa5ovLUNDfVbb1immSMzQ1xzWFLp0i3t+H AdOw== X-Gm-Message-State: ALoCoQnBEyFlZtt8lnS+PO27Omov8cPENM+A1dZoo2XlGzJDt0OKZ2oamhzmNyLVl9LRZxzJJ6dj X-Received: by 10.194.53.225 with SMTP id e1mr6734335wjp.4.1427630506125; Sun, 29 Mar 2015 05:01:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.38 with SMTP id w6ls536777laa.13.gmail; Sun, 29 Mar 2015 05:01:45 -0700 (PDT) X-Received: by 10.152.29.133 with SMTP id k5mr9919793lah.78.1427630505708; Sun, 29 Mar 2015 05:01:45 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id bl1si5225267lbc.77.2015.03.29.05.01.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Mar 2015 05:01:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagg8 with SMTP id g8so99222476lag.1 for ; Sun, 29 Mar 2015 05:01:45 -0700 (PDT) X-Received: by 10.112.8.101 with SMTP id q5mr24948343lba.19.1427630505200; Sun, 29 Mar 2015 05:01:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp869314lbq; Sun, 29 Mar 2015 05:01:44 -0700 (PDT) X-Received: by 10.70.35.101 with SMTP id g5mr49468491pdj.75.1427630503056; Sun, 29 Mar 2015 05:01:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fy4si10585196pbb.100.2015.03.29.05.01.42; Sun, 29 Mar 2015 05:01:43 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752701AbbC2MBf (ORCPT + 27 others); Sun, 29 Mar 2015 08:01:35 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:34506 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610AbbC2MBd (ORCPT ); Sun, 29 Mar 2015 08:01:33 -0400 Received: by oigz129 with SMTP id z129so62797507oig.1 for ; Sun, 29 Mar 2015 05:01:33 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.124.42 with SMTP id mf10mr22666982oeb.81.1427630493098; Sun, 29 Mar 2015 05:01:33 -0700 (PDT) Received: by 10.182.185.36 with HTTP; Sun, 29 Mar 2015 05:01:32 -0700 (PDT) In-Reply-To: <20150328134457.GK27490@worktop.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> <20150328095322.GH27490@worktop.programming.kicks-ass.net> <55169723.3070006@linaro.org> <20150328134457.GK27490@worktop.programming.kicks-ass.net> Date: Sun, 29 Mar 2015 17:31:32 +0530 Message-ID: Subject: Re: [RFC] vmstat: Avoid waking up idle-cpu to service shepherd work From: Viresh Kumar To: Peter Zijlstra Cc: Andrew Morton , Johannes Weiner , Christoph Lameter , Linaro Kernel Mailman List , Linux Kernel Mailing List , vinmenon@codeaurora.org, shashim@codeaurora.org, Michal Hocko , Mel Gorman , dave@stgolabs.net, Konstantin Khlebnikov , Linux Memory Management List , Suresh Siddha , Thomas Gleixner Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 28 March 2015 at 19:14, Peter Zijlstra wrote: > Yeah, something like the below (at the very end) should ensure the thing > is cacheline aligned, that should give us a fair few bits. > --- > kernel/time/timer.c | 36 ++++++++---------------------------- > 1 file changed, 8 insertions(+), 28 deletions(-) > > diff --git a/kernel/time/timer.c b/kernel/time/timer.c > index 2d3f5c504939..c8c45bf50b2e 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c > @@ -93,6 +93,7 @@ struct tvec_base { > struct tvec_base boot_tvec_bases; > EXPORT_SYMBOL(boot_tvec_bases); > static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases; > +static DEFINE_PER_CPU(struct tvec_base, __tvec_bases); > > /* Functions below help us manage 'deferrable' flag */ > static inline unsigned int tbase_get_deferrable(struct tvec_base *base) > @@ -1534,46 +1535,25 @@ EXPORT_SYMBOL(schedule_timeout_uninterruptible); > > static int init_timers_cpu(int cpu) > { > - int j; > - struct tvec_base *base; > + struct tvec_base *base = per_cpu(tvec_bases, cpu); > static char tvec_base_done[NR_CPUS]; > + int j; > > if (!tvec_base_done[cpu]) { > static char boot_done; > > - if (boot_done) { > - /* > - * The APs use this path later in boot > - */ > - base = kzalloc_node(sizeof(*base), GFP_KERNEL, > - cpu_to_node(cpu)); > - if (!base) > - return -ENOMEM; > - > - /* Make sure tvec_base has TIMER_FLAG_MASK bits free */ > - if (WARN_ON(base != tbase_get_base(base))) { > - kfree(base); > - return -ENOMEM; > - } > - per_cpu(tvec_bases, cpu) = base; > + if (!boot_done) { > + boot_done = 1; /* skip the boot cpu */ > } else { > - /* > - * This is for the boot CPU - we use compile-time > - * static initialisation because per-cpu memory isn't > - * ready yet and because the memory allocators are not > - * initialised either. > - */ > - boot_done = 1; > - base = &boot_tvec_bases; > + base = per_cpu_ptr(&__tvec_bases); > + per_cpu(tvec_bases, cpu) = base; > } > + > spin_lock_init(&base->lock); > tvec_base_done[cpu] = 1; > base->cpu = cpu; > - } else { > - base = per_cpu(tvec_bases, cpu); > } > > - > for (j = 0; j < TVN_SIZE; j++) { > INIT_LIST_HEAD(base->tv5.vec + j); > INIT_LIST_HEAD(base->tv4.vec + j); Even after this with following diff gives me the same warning on blackfin.. ---------x--------------------x---------------------- Warning: config: blackfin-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout ca713e393c6eceb54e803df204772a3d6e6c7981 # save the attached .config to linux build tree make.cross ARCH=blackfin All error/warnings: kernel/time/timer.c: In function 'init_timers': >> kernel/time/timer.c:1648:2: error: call to '__compiletime_assert_1648' declared with attribute error: BUILD_BUG_ON failed: __alignof__(struct tvec_base) & TIMER_FLAG_MASK --- 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/ diff --git a/include/linux/timer.h b/include/linux/timer.h index 8c5a197e1587..58bc28d9cef2 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -68,7 +68,7 @@ extern struct tvec_base boot_tvec_bases; #define TIMER_DEFERRABLE 0x1LU #define TIMER_IRQSAFE 0x2LU -#define TIMER_FLAG_MASK 0x3LU +#define TIMER_FLAG_MASK 0x7LU #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \ .entry = { .prev = TIMER_ENTRY_STATIC }, \