xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Keir Fraser <keir@xen.org>
Subject: Re: [PATCH v2] x86/PoD: shorten certain operations on higher order ranges
Date: Tue, 29 Sep 2015 14:03:18 +0100	[thread overview]
Message-ID: <560A8C16.8050803@citrix.com> (raw)
In-Reply-To: <560AA6E802000078000A6A64@prv-mh.provo.novell.com>

On 29/09/15 13:57, Jan Beulich wrote:
>>>> On 29.09.15 at 14:20, <andrew.cooper3@citrix.com> wrote:
>> On 28/09/15 15:30, Jan Beulich wrote:
>>> --- a/xen/arch/x86/mm/p2m-pod.c
>>> +++ b/xen/arch/x86/mm/p2m-pod.c
>>> @@ -119,20 +119,23 @@ p2m_pod_cache_add(struct p2m_domain *p2m
>>>  
>>>      unlock_page_alloc(p2m);
>>>  
>>> -    /* Then add the first one to the appropriate populate-on-demand list */
>>> -    switch(order)
>>> +    /* Then add to the appropriate populate-on-demand list. */
>>> +    switch ( order )
>>>      {
>>> +    case PAGE_ORDER_1G:
>>> +        for ( i = 0; i < (1UL << PAGE_ORDER_1G); i += 1UL << PAGE_ORDER_2M )
>>> +            page_list_add_tail(page + i, &p2m->pod.super);
>>> +        break;
>>>      case PAGE_ORDER_2M:
>>> -        page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */
>>> -        p2m->pod.count += 1 << order;
>>> +        page_list_add_tail(page, &p2m->pod.super);
>>>          break;
>>>      case PAGE_ORDER_4K:
>>> -        page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */
>>> -        p2m->pod.count += 1;
>>> +        page_list_add_tail(page, &p2m->pod.single);
>>>          break;
>>>      default:
>>>          BUG();
>>>      }
>>> +    p2m->pod.count += 1 << order;
>> 1UL
> Not really - the field is a "long" one, so at best 1L or 1U. And then
> all the valid order values are visible right above, for none of them
> it makes a difference, and there are ample similar uses scattered
> around the file (yes, bad examples are no excuse, but in cases
> where the suffix doesn't really matter I think it is better to omit it).
>
>> Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Let me know regrading this one,

For sanity sake, I would suggest going with 1L as one less place to go
wrong when we gain 512GB superpages.

~Andrew

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 14:30 [PATCH v2] x86/PoD: shorten certain operations on higher order ranges Jan Beulich
2015-09-29 12:20 ` Andrew Cooper
2015-09-29 12:57   ` Jan Beulich
2015-09-29 13:03     ` Andrew Cooper [this message]
2015-09-29 12:58 ` George Dunlap
2015-09-29 16:45 ` George Dunlap
2015-09-30 12:12   ` Jan Beulich
2015-09-30 14:23     ` George Dunlap
2015-09-30 15:40       ` 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=560A8C16.8050803@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.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).