All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Gardner <rob.gardner@hp.com>
To: david.hopwood@blueyonder.co.uk
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Changes to allow dynamic enabling/disabling of	trace buffers
Date: Sun, 30 Oct 2005 15:59:26 -0700	[thread overview]
Message-ID: <4365504E.8050808@hp.com> (raw)
In-Reply-To: <43654ED6.5070604@blueyonder.co.uk>

David,

Thanks for your comments. I'll make the changes you suggest.

Rob


David Hopwood wrote:

>Rob Gardner wrote:
>
>/**
> * tb_set_size - handle the logic involved with dynamically
> * allocating and deallocating tbufs
> *
> * This function is called when the SET_SIZE hypercall is done.
> */
>int tb_set_size(int size)
>{
>    // There are three cases to handle:
>    //  1. Changing from 0 to non-zero ==> simple allocate
>    //  2. Changing from non-zero to 0 ==> simple deallocate
>    //  3. Changing size ==> deallocate and reallocate? Or disallow?
>    //     User can just do a change to 0, then a change to the new size.
>
>They can, but the interface is slightly simpler if you allow this, and
>the implementation is also slightly shorter because you don't have to
>check for the error, or comment on it:
>
>    if (opt_tbuf_size > 0) {
>        int order = get_order_from_pages(num_online_cpus() * opt_tbuf_size);
>        // is there a way to undo SHARE_PFN_WITH_DOMAIN?
>        free_xenheap_pages(t_bufs[0], order);
>        opt_tbuf_size = 0;
>        printk("Xen trace buffers: uninitialized\n");
>    }
>    if (size > 0) {
>        // What if size is too big? alloc_xenheap will complain.
>        opt_tbuf_size = size;
>        if (alloc_trace_bufs() != 0)
>            return -EINVAL;
>        wmb();
>        printk("Xen trace buffers: initialized\n");
>    }
>    return 0;
>}
>
>The sentence "To change the size of an existing allocation, you must first
>deallocate it then reallocate it." should also be removed from the
>xc_tbuf_set_size doc comment.
>
>As a matter of style, I would also suggest moving the tb_init_done check into
>tb_set_size rather than doing it in the DOM0_TBUF_SET_SIZE handler.
>
>  
>

  reply	other threads:[~2005-10-30 22:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-30 21:14 [PATCH] Changes to allow dynamic enabling/disabling of trace buffers Rob Gardner
2005-10-30 22:53 ` David Hopwood
2005-10-30 22:59   ` Rob Gardner [this message]
2005-10-30 23:02   ` David Hopwood
2005-10-31  7:54   ` Keir Fraser
2005-10-31 14:42     ` Rob Gardner

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=4365504E.8050808@hp.com \
    --to=rob.gardner@hp.com \
    --cc=david.hopwood@blueyonder.co.uk \
    --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 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.