All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [PATCH v3 3/4] xen: refactor debugtrace data
Date: Tue, 3 Sep 2019 15:26:39 +0200	[thread overview]
Message-ID: <439c045b-127b-1944-a47d-4d33a0e42773@suse.com> (raw)
In-Reply-To: <8c915d3c-c022-a397-bf43-db98111ffd0a@suse.com>

On 03.09.19 13:50, Jan Beulich wrote:
> On 03.09.2019 12:31, Juergen Gross wrote:
>> On 03.09.19 12:16, Jan Beulich wrote:
>>> On 28.08.2019 10:00, Juergen Gross wrote:
>>>> +static unsigned int debugtrace_kilobytes = 128;
>>>
>>> Since you touch this anyway, add __initdata? Maybe also move it
>>> next to its integer_param()?
>>
>> This is modified in patch 4 again, and there I need it in the running
>> system for support of cpu hotplug with per-cpu buffers.
> 
> Right, I've meanwhile noticed this. Hence it's fine to keep as is.
> 
>>>> @@ -165,12 +171,14 @@ static int __init debugtrace_init(void)
>>>>            return 0;
>>>>    
>>>>        order = get_order_from_bytes(bytes);
>>>> -    debugtrace_buf = alloc_xenheap_pages(order, 0);
>>>> -    ASSERT(debugtrace_buf != NULL);
>>>> +    data = alloc_xenheap_pages(order, 0);
>>>> +    if ( !data )
>>>> +        return -ENOMEM;
>>>>    
>>>> -    memset(debugtrace_buf, '\0', bytes);
>>>> +    memset(data, '\0', bytes);
>>>>    
>>>> -    debugtrace_bytes = bytes;
>>>> +    data->bytes = bytes - sizeof(*data);
>>>> +    debtr_data = data;
>>>
>>> The allocation may end up being almost twice as big as what gets
>>> actually used this way. Wouldn't it make sense to re-calculate
>>> "bytes" from "order"?
>>
>> Yes, you are right.
> 
> Actually I wasn't, which I did notice seeing the relevant piece
> of code getting touched in patch 4:
> 
>      while ( (kbytes = (debugtrace_kilobytes & (debugtrace_kilobytes-1))) != 0 )
>          debugtrace_kilobytes = kbytes;

For kbytes < 4 you still were right.


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-09-03 13:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28  8:00 [Xen-devel] [PATCH v3 0/4] xen: debugtrace cleanup and per-cpu buffer support Juergen Gross
2019-08-28  8:00 ` [Xen-devel] [PATCH v3 1/4] xen: use common output function in debugtrace Juergen Gross
2019-09-03 10:00   ` Jan Beulich
2019-09-03 10:22     ` Juergen Gross
2019-09-03 11:47       ` Jan Beulich
2019-09-03 11:58         ` Juergen Gross
2019-09-03 12:09           ` Jan Beulich
2019-09-03 12:22             ` Juergen Gross
2019-09-03 12:40               ` Jan Beulich
2019-08-28  8:00 ` [Xen-devel] [PATCH v3 2/4] xen: move debugtrace coding to common/debugtrace.c Juergen Gross
2019-09-03 10:02   ` Jan Beulich
2019-08-28  8:00 ` [Xen-devel] [PATCH v3 3/4] xen: refactor debugtrace data Juergen Gross
2019-09-03 10:16   ` Jan Beulich
2019-09-03 10:31     ` Juergen Gross
2019-09-03 11:50       ` Jan Beulich
2019-09-03 13:26         ` Juergen Gross [this message]
2019-08-28  8:00 ` [Xen-devel] [PATCH v3 4/4] xen: add per-cpu buffer option to debugtrace Juergen Gross
2019-09-03 10:51   ` Jan Beulich
2019-09-03 11:10     ` Juergen Gross
2019-09-03 12:01       ` Jan Beulich
2019-09-03 12:10         ` 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=439c045b-127b-1944-a47d-4d33a0e42773@suse.com \
    --to=jgross@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wl@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.