Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbbLCTiU (ORCPT ); Thu, 3 Dec 2015 14:38:20 -0500 Received: from g1t6223.austin.hp.com ([15.73.96.124]:47691 "EHLO g1t6223.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895AbbLCTiT (ORCPT ); Thu, 3 Dec 2015 14:38:19 -0500 Message-ID: <56609A28.1090204@hpe.com> Date: Thu, 03 Dec 2015 14:38:16 -0500 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Peter Zijlstra CC: Ingo Molnar , linux-kernel@vger.kernel.org, Yuyang Du , Paul Turner , Ben Segall , 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> <20151203105607.GW3816@twins.programming.kicks-ass.net> In-Reply-To: <20151203105607.GW3816@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1418 Lines: 41 On 12/03/2015 05:56 AM, Peter Zijlstra wrote: > On Wed, Dec 02, 2015 at 01:41:49PM -0500, Waiman Long wrote: >> +/* >> + * Make sure that the task_group structure is cacheline aligned when >> + * fair group scheduling is enabled. >> + */ >> +#ifdef CONFIG_FAIR_GROUP_SCHED >> +static inline struct task_group *alloc_task_group(void) >> +{ >> + return kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO); >> +} >> + >> +static inline void free_task_group(struct task_group *tg) >> +{ >> + kmem_cache_free(task_group_cache, tg); >> +} >> +#else /* CONFIG_FAIR_GROUP_SCHED */ >> +static inline struct task_group *alloc_task_group(void) >> +{ >> + return kzalloc(sizeof(struct task_group), GFP_KERNEL); >> +} >> + >> +static inline void free_task_group(struct task_group *tg) >> +{ >> + kfree(tg); >> +} >> +#endif /* CONFIG_FAIR_GROUP_SCHED */ > I think we can simply always use the kmem_cache, both slab and slub > merge slabcaches where appropriate. I did that as I was not sure how much overhead would the introduction of a new kmem_cache bring. It seems like it is not really an issue. So I am fine with making the kmem_cache change permanent. Cheers, Longman -- 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/