All of lore.kernel.org
 help / color / mirror / Atom feed
* [LSF/MM/BPF TOPIC] Consolidating representations of the physical memory
@ 2021-06-09  7:44 Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2021-06-09  7:44 UTC (permalink / raw)
  To: lsf-pc, linux-mm

We have several coarse representations of the physical memory consisting of
[start, end, flags] structures per memory region. There is memblock that
some architectures keep after boot, there is iomem_resource tree and
"System RAM" nodes in that tree, there are memory blocks exposed in sysfs
and then there are per-architecture structures, sometimes even several per
architecture.

The multiplication of such structures and lack of consistency between some
of them does not help the maintainability and can be a reason for subtle
bugs here and there.

The layout of the physical memory is defined by hardware and firmware and
there is not much room for its interpretation; single abstraction of the
physical memory should suffice and a single [start, end, flags] type should
be enough. There is no fundamental reason why we cannot converge
per-architecture representations of the physical memory, like e820,
drmem_lmb, memblock or numa_meminfo into a generic abstraction.

I suggest to use memblock as the basis for such abstraction. It is already
supported on all architectures and it is used as the generic representation
of the physical memory at boot time. Closing the gaps between per
architecture structures and memblock is anyway required for more robust
initialization of the memory management. Addition of simple locking of
memblock data for memory hotplug, making the memblock "allocator" part
discardable and a mechanism to synchronize "System RAM" resources with
memblock would complete the picture.

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [LSF/MM/BPF TOPIC] Consolidating representations of the physical memory
@ 2022-02-01 19:06 Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2022-02-01 19:06 UTC (permalink / raw)
  To: lsf-pc, linux-mm

Hi all,

I've posted this last year, but last year was a bit slow for me, so nothing
really changed since then :(

We have several coarse representations of the physical memory consisting of
[start, end, flags] structures per memory region. There is memblock that
some architectures keep after boot, there is iomem_resource tree and
"System RAM" nodes in that tree, there are memory blocks exposed in sysfs
and then there are per-architecture structures, sometimes even several per
architecture.

The multiplication of such structures and lack of consistency between some
of them does not help the maintainability and can be a reason for subtle
bugs here and there.

The layout of the physical memory is defined by hardware and firmware and
there is not much room for its interpretation; single abstraction of the
physical memory should suffice and a single [start, end, flags] type should
be enough. There is no fundamental reason why we cannot converge
per-architecture representations of the physical memory, like e820,
drmem_lmb, memblock or numa_meminfo into a generic abstraction.

I suggest to use memblock as the basis for such abstraction. It is already
supported on all architectures and it is used as the generic representation
of the physical memory at boot time. Closing the gaps between per
architecture structures and memblock is anyway required for more robust
initialization of the memory management. Addition of simple locking of
memblock data for memory hotplug, making the memblock "allocator" part
discardable and a mechanism to synchronize "System RAM" resources with
memblock would complete the picture.

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-01 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  7:44 [LSF/MM/BPF TOPIC] Consolidating representations of the physical memory Mike Rapoport
2022-02-01 19:06 Mike Rapoport

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.