From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754902AbcJZKwi (ORCPT ); Wed, 26 Oct 2016 06:52:38 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:39484 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751365AbcJZKwb (ORCPT ); Wed, 26 Oct 2016 06:52:31 -0400 Date: Wed, 26 Oct 2016 12:49:36 +0200 (CEST) From: Thomas Gleixner To: Tim Chen cc: rjw@rjwysocki.net, mingo@redhat.com, bp@suse.de, x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, peterz@infradead.org, jolsa@redhat.com, Srinivas Pandruvada Subject: Re: [PATCH v6 5/9] x86/sysctl: Add sysctl for ITMT scheduling feature In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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 On Thu, 20 Oct 2016, Tim Chen wrote: > +static int sched_itmt_update_handler(struct ctl_table *table, int write, > + void __user *buffer, size_t *lenp, loff_t *ppos) Please align the arguments proper static int sched_itmt_update_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) > +{ > + int ret; > + unsigned int old_sysctl; unsigned int old_sysctl; int ret; Please. It's way simpler to read. > -void sched_set_itmt_support(void) > +int sched_set_itmt_support(void) > { > mutex_lock(&itmt_update_mutex); > > + if (sched_itmt_capable) { > + mutex_unlock(&itmt_update_mutex); > + return 0; > + } > + > + itmt_sysctl_header = register_sysctl_table(itmt_root_table); > + if (!itmt_sysctl_header) { > + mutex_unlock(&itmt_update_mutex); > + return -ENOMEM; > + } > + > sched_itmt_capable = true; > > + /* > + * ITMT capability automatically enables ITMT > + * scheduling for small systems (single node). > + */ > + if (topology_num_packages() == 1) > + sysctl_sched_itmt_enabled = 1; I really hate this. This is policy and the kernel should not impose policy. Why would I like to have this enforced on my single socket XEON server? > + if (sysctl_sched_itmt_enabled) { Why would sysctl_sched_itmt_enabled be true at this point, aside of the above policy imposement? Thanks, tglx