From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Volodymyr Babchuk" <volodymyr_babchuk@epam.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] trace: convert init_trace_bufs() to constructor
Date: Thu, 13 Mar 2025 15:19:40 +0100 [thread overview]
Message-ID: <b59ea14e-0bce-4c3e-b1fb-021b53af1780@suse.com> (raw)
In-Reply-To: <6ff81326-762c-46ec-a06a-254ba166433b@citrix.com>
On 13.03.2025 14:58, Andrew Cooper wrote:
> On 13/03/2025 1:38 pm, Jan Beulich wrote:
>> There's no need for each arch to invoke it directly, and there's no need
>> for having a stub either. With the present placement of the calls to
>> init_constructors() it can easily be a constructor itself.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> This has a side effect of wiring it up on RISC-V and PPC, as they
> process constructors. It looks safe enough, but have you double checked?
I've been looking at this differently: For both it can't be right for the
function to _not_ be called. And no matter that ...
> However, the position and logic during init is nonsense, I think.
>
> It registers a cpu notifier which only does spin_lock_init() on a
> per-cpu variable, which I think only works today because 0 is the init
> value.
>
> alloc_trace_bufs() on the other hand has a for_each_online_cpu() loop
> because it's too late and ought to be a presmp_initcall().
>
> Also the allocations could be NUMA-local for all but the biggest of
> servers (given the 16T upper limit because there are raw uint32_t's
> involved in the protocol).
... there's certainly further room for improvement, init_trace_bufs()
is all just "normal" code, which was already built before.
If there are missing pieces to make trace buffers fully working there,
that's no different from before the patch.
As to alloc_trace_bufs() - that has a 2nd caller, so converting to
presmp_initcall() may not buy us all that much.
> I'm tempted to ack this on the basis that it is an improvement, but a /*
> TODO this is all mad, please fix */ wouldn't go amiss either.
I understand you like adding such comments; I, however, at least
sometimes (e.g.) don't. Especially without at least outlining what
would need doing. Just saying "this is all mad" doesn't really help
very much.
Jan
next prev parent reply other threads:[~2025-03-13 14:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 13:38 [PATCH] trace: convert init_trace_bufs() to constructor Jan Beulich
2025-03-13 13:58 ` Andrew Cooper
2025-03-13 14:19 ` Jan Beulich [this message]
2025-03-13 16:28 ` Andrew Cooper
2025-03-13 16:37 ` Jan Beulich
2025-03-13 17:03 ` Andrew Cooper
2025-03-14 6:49 ` Jan Beulich
2025-03-14 11:35 ` Andrew Cooper
2025-03-27 14:49 ` Julien Grall
2025-03-27 15:08 ` Jan Beulich
2025-03-27 15:49 ` Julien Grall
2025-03-27 16:10 ` Jan Beulich
2025-03-27 21:48 ` Julien Grall
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=b59ea14e-0bce-4c3e-b1fb-021b53af1780@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=volodymyr_babchuk@epam.com \
--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.