All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86: make dump_pageframe_info() slightly more verbose for dying domains
Date: Mon, 22 Sep 2014 11:31:29 +0100	[thread overview]
Message-ID: <541FFA81.1040109@citrix.com> (raw)
In-Reply-To: <54130A920200007800034834@mail.emea.novell.com>

On 12/09/14 14:00, Jan Beulich wrote:
> Allowing more than just 10 pages to be printed in this case gives a
> better chance to fully understand eventual page reference leaks.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -151,15 +151,30 @@ void dump_pageframe_info(struct domain *
>  
>      printk("Memory pages belonging to domain %u:\n", d->domain_id);
>  
> -    if ( d->tot_pages >= 10 )
> +    if ( d->tot_pages >= 10 && d->is_dying < DOMDYING_dead )
>      {
>          printk("    DomPage list too long to display\n");
>      }
>      else
>      {
> +        unsigned long total[PGT_type_mask
> +                            / (PGT_type_mask & -PGT_type_mask) + 1] = {};

Is it possible to make use of something like:

#define LSB(x) ((x) & -(x))

for code clarity? (and perhaps for those whose bit manipulation
knowledge is a tad rusty)

Furthermore, the divide needs brackets per Xen style.  The current
layout makes it easy to mistake the +1 as being part of the divisor.

> +
>          spin_lock(&d->page_alloc_lock);
>          page_list_for_each ( page, &d->page_list )
>          {
> +            unsigned int index = (page->u.inuse.type_info & PGT_type_mask)
> +                                 / (PGT_type_mask & -PGT_type_mask);
> +
> +            if ( ++total[index] > 16 )
> +            {
> +                switch ( page->u.inuse.type_info & PGT_type_mask )
> +                {
> +                case PGT_none:
> +                case PGT_writable_page:
> +                    continue;
> +                }
> +            }

So, the new behaviour is to print all non none or writable_page, and
print the first 16 of each of those?  This is probably fine for
dying/dead domains only, but I feel it warrants a comment in the patch
description.

~Andrew

  reply	other threads:[~2014-09-22 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 13:00 [PATCH] x86: make dump_pageframe_info() slightly more verbose for dying domains Jan Beulich
2014-09-22 10:31 ` Andrew Cooper [this message]
2014-09-22 10:46   ` 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=541FFA81.1040109@citrix.com \
    --to=andrew.cooper3@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 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.