xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	Juergen Gross <juergen.gross@ts.fujitsu.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Avoid panic when adjusting sedf parameters
Date: Thu, 17 Nov 2011 13:52:48 +0000	[thread overview]
Message-ID: <CAEAC230.25135%keir.xen@gmail.com> (raw)
In-Reply-To: <4EC51A8D0200007800061933@nat28.tlf.novell.com>

On 17/11/2011 13:30, "Jan Beulich" <JBeulich@suse.com> wrote:

> which would now associate the else with the wrong (inner) if. One
> possible solution that comes to mind would be
> 
> #define for_each_domain_in_cpupool(_d,_c) \
>     for_each_domain_in_cpupool (_d) \
>         if ((_d)->cpupool != (_c)) \
>             continue; \
>         else
> 
> but I think I had seen a more clever solution to this problem, but cannot
> remember/locate it right now.

Given the gcc ({}) construction, you could do a double-loop:
 for ( (_d) = rcu_dereference(domain_list);     \
       (_d) != NULL;                            \
       ({ while ((_d) = rcu_dereference((_d)->next_in_list != NULL)
             if ((_d)->cpupool == (_c)) break;
          (_d); }) )

A bit ugly. ;-) And I still worry about cpupool locking...

 -- Keir

  parent reply	other threads:[~2011-11-17 13:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-17 13:03 [PATCH] Avoid panic when adjusting sedf parameters Juergen Gross
2011-11-17 13:30 ` Jan Beulich
2011-11-17 13:48   ` Keir Fraser
2011-11-17 14:02     ` Juergen Gross
2011-11-17 13:52   ` Keir Fraser [this message]
2011-11-17 14:04     ` Juergen Gross
2011-11-17 14:32       ` Jan Beulich
2011-11-17 14:41         ` Juergen Gross
2011-11-17 14:29     ` Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2011-11-17 14:37 Juergen Gross
2011-11-17 12:33 Juergen Gross
2011-11-17 12:43 ` George Dunlap
2011-11-17 13:07   ` Juergen Gross

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=CAEAC230.25135%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=juergen.gross@ts.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).