xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Keir Fraser <keir@xen.org>,
	David Vrabel <david.vrabel@citrix.com>
Subject: Re: [PATCH] scheduler: adjust internal locking interface
Date: Fri, 11 Oct 2013 15:41:34 +0100	[thread overview]
Message-ID: <52580E1E.30309@eu.citrix.com> (raw)
In-Reply-To: <5258294102000078000FA9A2@nat28.tlf.novell.com>

On 11/10/13 15:37, Jan Beulich wrote:
>>>> On 11.10.13 at 16:29, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 11/10/13 15:14, Jan Beulich wrote:
>>> +#define sched_lock(kind, param, cpu, irq, arg...) \
>>> +static inline spinlock_t *kind##_schedule_lock##irq(param EXTRA_TYPE(arg))
>> \
>>> +{ \
>>> +    for ( ; ; ) \
>>> +    { \
>>> +        spinlock_t *lock = per_cpu(schedule_data, cpu).schedule_lock; \
>>> +        /* \
>>> +         * v->processor may change when grabbing the lock; but \
>>> +         * per_cpu(v->processor) may also change, if changing cpu pool \
>>> +         * also changes the scheduler lock.  Retry until they match. \
>>> +         * \
>>> +         * It may also be the case that v->processor may change but the \
>>> +         * lock may be the same; this will succeed in that case. \
>>> +         */ \
>>> +        spin_lock##irq(lock, ## arg); \
>>> +        if ( likely(lock == per_cpu(schedule_data, cpu).schedule_lock) ) \
>>> +            return lock; \
>>> +        spin_unlock##irq(lock, ## arg); \
>>> +    } \
>>>   }
>> The readability of this (and others) would be much easier if the '\'
>> were aligned on the RHS and out of view of the main body.
> This depends on the fonts you use - in a mail reader using variable
> width fonts it reads much better the way I coded it. And while I
> realized that there are may cases where there is right alignment of
> these line continuations, I'm personally not in favor of this style,
> and since the coding style document doesn't say anything about it
> I used my personal preference...

But what we care about is how it looks in an editor.  I presume when 
you're actually coding you use a fixed-width font? :-)

  -George

  reply	other threads:[~2013-10-11 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 14:14 [PATCH] scheduler: adjust internal locking interface Jan Beulich
2013-10-11 14:29 ` Andrew Cooper
2013-10-11 14:37   ` Jan Beulich
2013-10-11 14:41     ` George Dunlap [this message]
2013-10-11 15:03       ` Jan Beulich
2013-10-11 15:13 ` [PATCH v2 0/2] scheduler locking adjustments Jan Beulich
2013-10-11 15:16   ` [PATCH v2 1/2] scheduler: adjust internal locking interface Jan Beulich
2013-10-11 15:17   ` [PATCH v2 2/2] sched: fix race between sched_move_domain() and vcpu_wake() Jan Beulich
2013-10-11 16:14   ` [PATCH v2 0/2] scheduler locking adjustments Andrew Cooper
2013-10-11 17:17   ` Keir Fraser

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=52580E1E.30309@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=keir@xen.org \
    --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 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).