All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xenproject.org
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>
Subject: Re: [Xen-devel] [PATCH v5 3/4] xen: refactor debugtrace data
Date: Thu, 5 Sep 2019 16:36:44 +0200	[thread overview]
Message-ID: <c417375c-b216-8160-e4aa-bc61e0a7a901@suse.com> (raw)
In-Reply-To: <c5e744c2-73e7-3a6c-6404-b7596c1c24e3@suse.com>

On 05.09.19 14:46, Juergen Gross wrote:
> On 05.09.19 14:37, Jan Beulich wrote:
>> On 05.09.2019 14:27, Juergen Gross wrote:
>>> On 05.09.19 14:22, Jan Beulich wrote:
>>>> On 05.09.2019 14:12, Juergen Gross wrote:
>>>>> On 05.09.19 14:01, Jan Beulich wrote:
>>>>>> On 05.09.2019 13:39, Juergen Gross wrote:
>>>>>>> As a preparation for per-cpu buffers do a little refactoring of the
>>>>>>> debugtrace data: put the needed buffer admin data into the buffer as
>>>>>>> it will be needed for each buffer. In order not to limit buffer size
>>>>>>> switch the related fields from unsigned int to unsigned long, as on
>>>>>>> huge machines with RAM in the TB range it might be interesting to
>>>>>>> support buffers >4GB.
>>>>>>
>>>>>> Just as a further remark in this regard:
>>>>>>
>>>>>>>     void debugtrace_printk(const char *fmt, ...)
>>>>>>>     {
>>>>>>>         static char buf[DEBUG_TRACE_ENTRY_SIZE];
>>>>>>> -    static unsigned int count, last_count, last_prd;
>>>>>>> +    static unsigned int count, last_count;
>>>>>>
>>>>>> How long do we think will it take until their wrapping will become
>>>>>> an issue with such huge buffers?
>>>>>
>>>>> Count wrapping will not result in any misbehavior of tracing. With
>>>>> per-cpu buffers it might result in ambiguity regarding sorting the
>>>>> entries, but I guess chances are rather low this being a real issue.
>>>>>
>>>>> BTW: wrapping of count is not related to buffer size, but to the
>>>>> amount of trace data written.
>>>>
>>>> Sure, but the chance of ambiguity increases with larger buffer sizes.
>>>
>>> Well, better safe than sorry. Switching to unsigned long will rarely
>>> hurt, so I'm going to do just that. The only downside will be some waste
>>> of buffer space for very long running traces with huge amounts of
>>> entries.
>>
>> Hmm, true. Maybe we could get someone else's opinion on this - anyone?
> 
> TBH, I wouldn't be concerned about the buffer space. In case there are
> really billions of entries, the difference between a 10-digit count
> value and maybe a 15 digit one (and that is already a massive amount)
> isn't that large. The average printed size of count with about
> 4 billion entries is 9.75 digits (and not just 5 :-) ).

Another option would be to let count wrap at e.g. 4 billion (or even 1
million) and add a wrap count. Each buffer struct would contain the
wrap count of the last entry, and when hitting a higher wrap count a
new entry like ("wrap %u->%u", old_wrap, new_wrap) would be printed.
This saves buffer space without loosing information.


Juergen

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

  reply	other threads:[~2019-09-05 14:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 11:39 [Xen-devel] [PATCH v5 0/4] xen: debugtrace cleanup and per-cpu buffer support Juergen Gross
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 1/4] xen: fix debugtrace clearing Juergen Gross
2019-09-05 12:17   ` Jan Beulich
2019-09-05 12:22     ` Juergen Gross
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 2/4] xen: move debugtrace coding to common/debugtrace.c Juergen Gross
2019-09-05 12:20   ` Jan Beulich
2019-09-05 12:32     ` Juergen Gross
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 3/4] xen: refactor debugtrace data Juergen Gross
2019-09-05 12:01   ` Jan Beulich
2019-09-05 12:12     ` Juergen Gross
2019-09-05 12:22       ` Jan Beulich
2019-09-05 12:27         ` Juergen Gross
2019-09-05 12:37           ` Jan Beulich
2019-09-05 12:46             ` Juergen Gross
2019-09-05 14:36               ` Juergen Gross [this message]
2019-09-05 14:43                 ` Jan Beulich
2019-09-06  8:49                   ` Juergen Gross
2019-09-06  9:10                     ` Jan Beulich
2019-09-06  9:21                       ` Juergen Gross
2019-09-05 12:13   ` Jan Beulich
2019-09-05 12:19     ` Juergen Gross
2019-09-05 12:24       ` Jan Beulich
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 4/4] xen: add per-cpu buffer option to debugtrace Juergen Gross
2019-09-05 11:58   ` 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=c417375c-b216-8160-e4aa-bc61e0a7a901@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.