Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752179AbbLCSBw (ORCPT ); Thu, 3 Dec 2015 13:01:52 -0500 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34540 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbbLCSBv (ORCPT ); Thu, 3 Dec 2015 13:01:51 -0500 X-Greylist: delayed 342 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Dec 2015 13:01:50 EST From: bsegall@google.com To: Peter Zijlstra Cc: Waiman Long , Ingo Molnar , linux-kernel@vger.kernel.org, Yuyang Du , Paul Turner , Morten Rasmussen , Scott J Norton , Douglas Hatch Subject: Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline References: <1449081710-20185-1-git-send-email-Waiman.Long@hpe.com> <1449081710-20185-3-git-send-email-Waiman.Long@hpe.com> <20151203111209.GX3816@twins.programming.kicks-ass.net> Date: Thu, 03 Dec 2015 09:56:02 -0800 In-Reply-To: <20151203111209.GX3816@twins.programming.kicks-ass.net> (Peter Zijlstra's message of "Thu, 3 Dec 2015 12:12:09 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1414 Lines: 47 Peter Zijlstra writes: > I made this: > > --- > Subject: sched/fair: Move hot load_avg into its own cacheline > From: Waiman Long > Date: Wed, 2 Dec 2015 13:41:49 -0500 > [...] > @@ -7402,11 +7405,12 @@ void __init sched_init(void) > #endif /* CONFIG_RT_GROUP_SCHED */ > > #ifdef CONFIG_CGROUP_SCHED > + task_group_cache = KMEM_CACHE(task_group, 0); > + > list_add(&root_task_group.list, &task_groups); > INIT_LIST_HEAD(&root_task_group.children); > INIT_LIST_HEAD(&root_task_group.siblings); > autogroup_init(&init_task); > - > #endif /* CONFIG_CGROUP_SCHED */ > > for_each_possible_cpu(i) { > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -248,7 +248,12 @@ struct task_group { > unsigned long shares; > > #ifdef CONFIG_SMP > - atomic_long_t load_avg; > + /* > + * load_avg can be heavily contended at clock tick time, so put > + * it in its own cacheline separated from the fields above which > + * will also be accessed at each tick. > + */ > + atomic_long_t load_avg ____cacheline_aligned; > #endif > #endif > This loses the cacheline-alignment for task_group, is that ok? -- 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/