xen/scheduler: remove 'name' from 'struct scheduler'
PATCH 1/1 xen/scheduler: remove 'name' from 'struct scheduler'
'struct scheduler' already has member 'opt_name' and 'sched_id', thus 'name' is a little redundant, so remove it.
--- xen/common/sched_arinc653.c | 1 - xen/common/sched_credit.c | 1 - xen/common/sched_credit2.c | 1 - xen/common/sched_null.c | 1 - xen/common/sched_rt.c | 1 - xen/common/schedule.c | 12 ++++++------ xen/include/xen/sched-if.h | 3 +-- 7 files changed, 7 insertions(+), 13 deletions(-)
xen/common/sched_arinc653.c +0 -1
@@ -701,7 +701,6 @@ a653sched_adjust_global(const struct scheduler *ops,* The symbol must be visible to the rest of Xen at link time. */ static const struct scheduler sched_arinc653_def = { - .name ="ARINC 653 Scheduler" , .opt_name ="arinc653" , .sched_id =XEN_SCHEDULER_ARINC653 , .sched_data =NULL ,
xen/common/sched_credit.c +0 -1
@@ -2262,7 +2262,6 @@ static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu) }static const struct scheduler sched_credit_def = { - .name ="SMP Credit Scheduler" , .opt_name ="credit" , .sched_id =XEN_SCHEDULER_CREDIT , .sched_data =NULL ,
xen/common/sched_credit2.c +0 -1
@@ -4076,7 +4076,6 @@ csched2_deinit(struct scheduler *ops) }static const struct scheduler sched_credit2_def = { - .name ="SMP Credit Scheduler rev2" , .opt_name ="credit2" , .sched_id =XEN_SCHEDULER_CREDIT2 , .sched_data =NULL ,
xen/common/sched_null.c +0 -1
@@ -871,7 +871,6 @@ static void null_dump(const struct scheduler *ops) }static const struct scheduler sched_null_def = { - .name ="null Scheduler" , .opt_name ="null" , .sched_id =XEN_SCHEDULER_NULL , .sched_data =NULL ,
xen/common/sched_rt.c +0 -1
@@ -1541,7 +1541,6 @@ static void repl_timer_handler(void *data){ }static const struct scheduler sched_rtds_def = { - .name ="SMP RTDS Scheduler" , .opt_name ="rtds" , .sched_id =XEN_SCHEDULER_RTDS , .sched_data =NULL ,
xen/common/schedule.c +6 -6
@@ -1729,11 +1729,11 @@ void __init scheduler_init(void) {if ( schedulers[i]->global_init && schedulers[i]->global_init () <0 ) schedulers[i] =NULL ; -else if ( !ops.name && !strcmp (schedulers[i]->opt_name, opt_sched) ) +else if ( !ops.opt_name && !strcmp (schedulers[i]->opt_name, opt_sched) ) ops = *schedulers[i]; } -if ( !ops.name ) +if ( !ops.opt_name ) {printk ("Could not find scheduler: %s\n" , opt_sched);for ( i =0 ; i <NUM_SCHEDULERS ; i++ )
@@ -1743,15 +1743,15 @@ void __init scheduler_init(void) ops = *schedulers[i];break ; } -BUG_ON (!ops.name); -printk ("Using '%s' (%s)\n" , ops.name, ops.opt_name); +BUG_ON (!ops.opt_name); +printk ("Using scheduler (%s)\n" , ops.opt_name); }if (cpu_schedule_up (0 ) )BUG ();register_cpu_notifier (&cpu_schedule_nfb); -printk ("Using scheduler: %s (%s)\n" , ops.name, ops.opt_name); +printk ("Using scheduler: (%s)\n" , ops.opt_name);if (SCHED_OP (&ops, init) )panic ("scheduler returned error on init\n" );
@@ -1926,7 +1926,7 @@ void schedule_dump(struct cpupool *c) { sched = c->sched; cpus = c->cpu_valid; -printk ("Scheduler: %s (%s)\n" , sched->name, sched->opt_name); +printk ("Scheduler: (%s)\n" , sched->opt_name);SCHED_OP (sched, dump_settings); } else
xen/include/xen/sched-if.h +1 -2
@@ -130,8 +130,7 @@ struct task_slice { };struct scheduler { -char *name;/* full name for this scheduler */ -char *opt_name;/* option name for this scheduler */ +const char *opt_name;/* option name for this scheduler */ unsigned int sched_id;/* ID for this scheduler */ void *sched_data;/* global data pointer */
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines · Baodong Chen
'struct scheduler' already has member '
opt_name' and 'sched_id', thus 'name' is a little redundant, so remove it.Signed-off-by Baodong Chen <[email protected]>
It's not redundant; one is a longer-form human-readable description, another is a shorthand "option" description.
You can't be saving more than what, 500 bytes here? I understand you're trying to cut things down as small as you can, but this seems a bit excessive.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 11 lines · George Dunlap
Quoted 4 lines · Baodong Chen
'struct scheduler' already has member '
opt_name' and 'sched_id', thus 'name' is a little redundant, so remove it.Signed-off-by Baodong Chen <[email protected]>It's not redundant; one is a longer-form human-readable description, another is a shorthand "option" description.
You can't be saving more than what, 500 bytes here? I understand you're trying to cut things down as small as you can, but this seems a bit excessive.
Hello George,
Roger that.
I thought besides 'name', both 'opt_name' and 'sched_id' can identify
the scheduler and the 'name' mainly used in logs, thus can be removed.
As your suggestion, can leave it as it is.
Quoted 3 lines
-George
.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel