Xen-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Uma Sharma <uma.sharma523@gmail.com>,
	xen-devel@lists.xen.org
Cc: dario.faggioli@citrix.com, George.Dunlap@citrix.com, JBeulich@suse.com
Subject: Re: [PATCH v2 2/2] sched_credit2.c: runqueue_per_core code
Date: Fri, 13 Mar 2015 19:13:50 +0000	[thread overview]
Message-ID: <550336EE.60909@eu.citrix.com> (raw)
In-Reply-To: <55032C85.6090805@citrix.com>

On 03/13/2015 06:29 PM, Andrew Cooper wrote:

>> +#define CREDIT2_OPT_RUNQUEUE_CORE 1
>> +#define CREDIT2_OPT_RUNQUEUE_SOCKET 2
> 
> You can drop _OPT out of the name.  It serves only to make the constant
> longer.

I suggested _OPT so that nobody would be confused into thinking they
were used in the core mechanism.

> Also, this should probably be an enum as the exact numbers themselves
> are not interesting.

I also suggested #defines, since there are only 2, and the rest of the
code doesn't really use enums.

> 
>>  
>>  int opt_migrate_resist=500;
>>  integer_param("sched_credit2_migrate_resist", opt_migrate_resist);
>> +char __initdata opt_credit2_runqueue_string[10] = "core";
>> +string_param("credit2_runqueue", opt_credit2_runqueue_string);
>> +int opt_credit2_runqueue = CREDIT2_OPT_RUNQUEUE_CORE;
>>  
>>  /*
>>   * Useful macros
>> @@ -1940,10 +1946,10 @@ static void init_pcpu(const struct scheduler *ops, int cpu)
>>  
>>      /* Figure out which runqueue to put it in */
>>      /* NB: cpu 0 doesn't get a STARTING callback, so we hard-code it to runqueue 0. */
>> -    if ( cpu == 0 )
>> -        rqi = 0;
>> +    if ( opt_credit2_runqueue == CREDIT2_OPT_RUNQUEUE_SOCKET )
>> +        rqi = cpu ? cpu_to_socket(cpu) : boot_cpu_to_socket();
> 
> This conditional is bogus.  If cpu0 is offlined and re-onlined, it must
> use cpu_to_core()
> 
> This entire hunk should probably be
> 
> rqi = (opt_credit2_runqueue == CREDIT2_OPT_RUNQUEUE_SOCKET) ?
> cpu_to_socket(cpu) : cpu_to_core(cpu);
> 
> (with suitable alignment)

You're ignoring the fact that she's following suit from existing code;
and that that code is there for a reason: When this is first called for
cpu 0, cpu_to_socket() (and cpu_to_core()) return garbage since they
haven't been initialized yet.

That is something that needs to be fixed, but it's not Uma's job to fix it.

 -George

  reply	other threads:[~2015-03-13 19:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 18:11 [PATCH v2 2/2] sched_credit2.c: runqueue_per_core code Uma Sharma
2015-03-13 18:29 ` Andrew Cooper
2015-03-13 19:13   ` George Dunlap [this message]
2015-03-16 12:48     ` Jan Beulich
2015-03-16 12:51       ` George Dunlap
2015-03-16 12:56         ` Jan Beulich
2015-03-16 13:26           ` Dario Faggioli
2015-03-17 18:18           ` Dario Faggioli
2015-03-18  7:56             ` Jan Beulich
2015-03-18  8:53               ` Dario Faggioli
2015-03-18 15:26                 ` George Dunlap
2015-03-18 15:59                   ` Jan Beulich
2015-03-18 16:08                     ` George Dunlap
2015-03-18 16:30                       ` Dario Faggioli
2015-03-18 16:49                   ` Dario Faggioli
2015-03-18 17:05                     ` George Dunlap
2015-03-19 10:03                       ` Dario Faggioli
2015-03-19 10:50                         ` Jan Beulich
2015-03-19 11:23                           ` Dario Faggioli
2015-03-19 11:40                           ` George Dunlap
2015-03-19 12:29                             ` Dario Faggioli
2015-03-19 12:35                               ` George Dunlap
2015-03-19 13:00                                 ` Dario Faggioli
2015-03-16 12:45 ` Jan Beulich
2015-03-16 12:49 ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550336EE.60909@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=uma.sharma523@gmail.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox