diff mbox series

[2/2] core-parking: adjust data/code placement

Message ID 5CAF36FF02000078002269C1@prv1-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show
Series core-parking: SMT-disable and section adjustments | expand

Commit Message

Jan Beulich April 11, 2019, 12:45 p.m. UTC
Use __init{data,}, __read_mostly, and const as far as possible.

Take the liberty and also shorten the policy structure's tag name.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper April 11, 2019, 7:01 p.m. UTC | #1
On 11/04/2019 13:45, Jan Beulich wrote:
> Use __init{data,}, __read_mostly, and const as far as possible.
>
> Take the liberty and also shorten the policy structure's tag name.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

--- a/xen/common/core_parking.c
+++ b/xen/common/core_parking.c
@@ -29,15 +29,15 @@  static DEFINE_SPINLOCK(accounting_lock);
 static uint32_t cur_idle_nums;
 static unsigned int core_parking_cpunum[NR_CPUS] = {[0 ... NR_CPUS-1] = -1};
 
-static struct core_parking_policy {
+static const struct cp_policy {
     char name[30];
     unsigned int (*next)(unsigned int event);
-} *core_parking_policy;
+} *__read_mostly core_parking_policy;
 
 static enum core_parking_controller {
     POWER_FIRST,
     PERFORMANCE_FIRST
-} core_parking_controller = POWER_FIRST;
+} core_parking_controller __initdata = POWER_FIRST;
 
 static int __init setup_core_parking_option(const char *str)
 {
@@ -238,17 +238,17 @@  uint32_t get_cur_idle_nums(void)
     return cur_idle_nums;
 }
 
-static struct core_parking_policy power_first = {
+static const struct cp_policy power_first = {
     .name = "power",
     .next = core_parking_power,
 };
 
-static struct core_parking_policy performance_first = {
+static const struct cp_policy performance_first = {
     .name = "performance",
     .next = core_parking_performance,
 };
 
-static int register_core_parking_policy(struct core_parking_policy *policy)
+static int __init register_core_parking_policy(const struct cp_policy *policy)
 {
     if ( !policy || !policy->next )
         return -EINVAL;