All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>
Subject: Re: [for-4.8 PATCH] xen: credit2: fix wrong assert in runq_tickle().
Date: Tue, 22 Nov 2016 12:52:04 +0100	[thread overview]
Message-ID: <1479815524.2712.19.camel@citrix.com> (raw)
In-Reply-To: <5834384A02000078001209E3@prv-mh.provo.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 2315 bytes --]

On Tue, 2016-11-22 at 04:21 -0700, Jan Beulich wrote:
> > > > On 22.11.16 at 11:43, <dario.faggioli@citrix.com> wrote:
> > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
Thanks a lot for looking at the patch.

> with two remarks:
>
> [...]
> 
> If you moved this past the if() following this comment, the ipid ==
> -1
> case would already be taken care of, simplifying the code.
> 
True. Though about it, but was two minded.

I think the ASSERT is more 'descriptive' if it's kept as close as
possible to the for (and in fact, I now even regret having put a blank
line in between). But I see your point and agree that it's looking
awkward when you see it together with the following if.

So, yes, all in all, I think I like your idea better.

> And then, having looked back at the commit mentioned in the
> description, that one resulted in two constructs like (taking the
> code as it looks now)
> 
>             if ( cpumask_test_cpu(cpu, &rqd->idle) )
>             {
>                 __cpumask_clear_cpu(cpu, &rqd->idle);
>                 ...
> 
> Is there a reason this can't or shouldn't be
> 
>             if ( __cpumask_test_and_clear_cpu(cpu, &rqd->idle) )
>             {
>                 ...
> ?
> 
It can indeed. You can find it done as it is right now in other places,
in scheduling code, though, I guess for cache betterness, as Juergen is
saying. I remember not being sure which way to go, and eventually
leaning toward this one.

I'm still not sure what's best, but it'd be a cleanup/optimization, and
would IMO require, if done, more than just that (e.g., comments should
be improved). So I'd be inclined to consider this 4.9 material... But
thanks for bringing it up. :-)

So, I'm resending this patch with the ASSERT moved below the if, and
I'm keeping your Reviewed-by. Hope that's ok.

Thanks again and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-11-22 11:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 10:43 [for-4.8 PATCH] xen: credit2: fix wrong assert in runq_tickle() Dario Faggioli
2016-11-22 10:55 ` Wei Liu
2016-11-22 11:21 ` Jan Beulich
2016-11-22 11:38   ` Juergen Gross
2016-11-22 11:52   ` Dario Faggioli [this message]
2016-11-22 13:00     ` 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=1479815524.2712.19.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.