From: Thomas Gleixner <tglx@linutronix.de>
To: David Hildenbrand <david@redhat.com>,
Eugen Hristev <eugen.hristev@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, andersson@kernel.org, pmladek@suse.com,
rdunlap@infradead.org, corbet@lwn.net, mhocko@suse.com
Cc: tudor.ambarus@linaro.org, mukesh.ojha@oss.qualcomm.com,
linux-arm-kernel@lists.infradead.org,
linux-hardening@vger.kernel.org, jonechou@google.com,
rostedt@goodmis.org, linux-doc@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [RFC][PATCH v3 09/16] genirq/irqdesc: Have nr_irqs as non-static
Date: Wed, 17 Sep 2025 20:42:54 +0200 [thread overview]
Message-ID: <87segk9az5.ffs@tglx> (raw)
In-Reply-To: <7f4aa4c6-7b77-422b-9f7a-d01530c54bff@redhat.com>
On Wed, Sep 17 2025 at 17:18, David Hildenbrand wrote:
> On 17.09.25 17:02, Eugen Hristev wrote:
>> On 9/17/25 17:46, David Hildenbrand wrote:
>>> On 17.09.25 16:10, Thomas Gleixner wrote:
>>>> Sorry. I was busy with other stuff and did not pay attention to that
>>>> discussion.
>>>
>>> I understand, I'm busy with too much stuff such that sometimes it might
>>> be good to interrupt me earlier: "David, nooo, you're all wrong"
I know that feeling.
>> The idea was to make "kmemdump" exactly this generic way to tag/describe
>> the memory.
>
> That's probably where I got lost, after reading the cover letter
> assuming that this is primarily to program kmemdump backends, which I
> understood to just special hw/firmware areas, whereby kinfo acts as a
> filter.
>
>> If we would call it differently , simply dump , would it be better ?
>> e.g. include linux/dump.h
>> and then DUMP(var, size) ?
>>
>> could we call it maybe MARK ? or TAG ?
>> TAG_MEM(area, size)
>
> I'm wondering whether there could be any other user for this kind of
> information.
>
> Like R/O access in a debug kernel to these areas, exporting the
> ranges/names + easy read access to content through debugfs or something.
>
> Guess that partially falls under the "dump" category.
I'd rather call it inspection.
> Including that information in a vmcore info would probably allow to
> quickly extract some information even without the debug symbols around
> (I run into that every now and then).
Correct.
>> this would go to a separate section called .tagged_memory.
That'd be confusing vs. actual memory tags, no?
> Maybe just "tagged_memory.h" or sth. like that? I'm bad at naming, so I
> would let others make better suggestions.
inspect.h :)
I'm going to use 'inspect' as prefix for the thoughts below, but that's
obviously subject to s/inspect/$BETTERNAME/g :)
>> Then anyone can walk through the section and collect the data.
>>
>> I am just coming up with ideas here.
>> Could it be even part of mm.h instead of having a new header perhaps ?
>> Then we won't need to include one more.
>
> I don't really have something against a new include, just not one that
> sounded like a very specific subsystem, not something more generic.
Right. We really don't want to have five different mechanisms for five
infrastructures which all allow to inspect kernel memory (life or
dead) in one way or the other. The difference between them is mostly:
- Which subset of the information they expose for inspection
- The actual exposure mechanism: crash dump, firmware storage,
run-time snapshots in a filesystem, ....
Having one shared core infrastructure to expose data to those mechanisms
makes everyones life simpler.
That obviously needs to collect the superset of data, but that's just a
bit more memory consumed. That's arguably significantly smaller than
supporting a zoo of mechanisms to register data for different
infrastructures.
I'm quite sure that at least a substantial amount of the required
information can be collected at compile time in special section
tables. The rest can be collected in runtime tables, which have the same
format as the compile time section tables to avoid separate parsers.
Let me just float some ideas here, how that might look like. It might be
completely inpractical, but then it might be at least fodder for
thoughts.
As this is specific for the compiled kernel version you can define an
extensible struct format for the table.
struct inspect_entry {
unsigned long properties;
unsigned int type;
unsigned int id;
const char name[$MAX_NAME_LEN];
unsigned long address;
unsigned long length;
....
};
@type
refers either to a table with type information, which describes
the struct in some way or just generate a detached compile time
description.
@id
a unique id created at compile time or via registration at
runtime. Might not be required
@name:
Name of the memory region. That might go into a separate table
which is referenced by @id, but that's up for debate.
@address:
@length:
obvious :)
...
Whatever a particular consumer might require
@properties:
A "bitfield", which allows to mark this entry as (in)valid for a
particular consumer.
That obviously requires to modify these properties when the
requirements of a consumer change, new consumers arrive or new
producers are added, but I think it's easier to do that at the
producer side than maintaining filters on all consumer ends
forever.
Though I might be wrong as usual. IOW this needs some thoughts. :)
The interesting engineering challenge with such a scheme is to come up
with a annotation mechanism which is extensible.
Runtime is trivial as it just needs to fill in the new field in the
datastructure and all other runtime users have that zero
initialized automatically, if you get the mechanism correct in the
first place. Think in templates :)
Compile time is a bit more effort, but that should be solvable with
key/value pairs.
Don't even waste a thought about creating the final tables and
sections in macro magic. All the annotation macros have to do is to
emit the pairs in a structured way into discardable sections.
Those section are then converted in post processing into the actual
section table formats and added to the kernel image. Not a
spectacular new concept. The kernel build does this already today.
Just keep the compile time annotation macro magic simple and
stupid. It can waste 10k per entry at compile time and then let
postprocessing worry about downsizing and consolidation. Nothing to
see here :)
Hope that helps.
Thanks,
tglx
next prev parent reply other threads:[~2025-09-17 18:43 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 15:08 [RFC][PATCH v3 00/16] Introduce kmemdump Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 01/16] kmemdump: " Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 02/16] Documentation: Add kmemdump Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 03/16] kmemdump: Add coreimage ELF layer Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 04/16] Documentation: kmemdump: Add section for coreimage ELF Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 05/16] kernel/vmcore_info: Register dynamic information into Kmemdump Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 06/16] kmemdump: Introduce qcom-minidump backend driver Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 07/16] soc: qcom: smem: Add minidump device Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 08/16] init/version: Add banner_len to save banner length Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 09/16] genirq/irqdesc: Have nr_irqs as non-static Eugen Hristev
2025-09-16 21:10 ` Thomas Gleixner
2025-09-16 21:16 ` Thomas Gleixner
2025-09-17 5:43 ` Eugen Hristev
2025-09-17 7:16 ` David Hildenbrand
2025-09-17 14:10 ` Thomas Gleixner
2025-09-17 14:26 ` Eugen Hristev
2025-09-17 14:46 ` David Hildenbrand
2025-09-17 15:02 ` Eugen Hristev
2025-09-17 15:18 ` David Hildenbrand
2025-09-17 15:32 ` Eugen Hristev
2025-09-17 15:44 ` David Hildenbrand
2025-09-17 18:42 ` Thomas Gleixner [this message]
2025-09-17 19:03 ` David Hildenbrand
2025-09-18 8:23 ` Thomas Gleixner
2025-09-18 13:53 ` Eugen Hristev
2025-09-18 18:43 ` Randy Dunlap
2025-09-25 20:11 ` David Hildenbrand
2025-09-12 15:08 ` [RFC][PATCH v3 10/16] panic: Have tainted_mask " Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 11/16] mm/swapfile: Have nr_swapfiles " Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 12/16] printk: Register information into Kmemdump Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 13/16] sched: Add sched_get_runqueues_area Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 14/16] kernel/vmcoreinfo: Register kmemdump core image information Eugen Hristev
2025-09-12 15:08 ` [RFC][PATCH v3 15/16] kmemdump: Add Kinfo backend driver Eugen Hristev
2025-09-16 5:48 ` Alexey Klimov
2025-09-22 10:01 ` Tudor Ambarus
2025-09-12 15:08 ` [RFC][PATCH v3 16/16] dt-bindings: Add Google Kinfo Eugen Hristev
2025-09-14 11:56 ` Krzysztof Kozlowski
2025-09-12 15:56 ` [RFC][PATCH v3 00/16] Introduce kmemdump David Hildenbrand
2025-09-12 18:35 ` Eugen Hristev
2025-09-16 7:49 ` Mukesh Ojha
2025-09-16 15:25 ` Luck, Tony
2025-09-16 15:27 ` Eugen Hristev
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=87segk9az5.ffs@tglx \
--to=tglx@linutronix.de \
--cc=andersson@kernel.org \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=eugen.hristev@linaro.org \
--cc=jonechou@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mukesh.ojha@oss.qualcomm.com \
--cc=pmladek@suse.com \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tudor.ambarus@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox