Skip to content

Shrinking DT memory usage

Rob Herring linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6of: fix missing kobject init for !SYSFS && OF_DYNAMIC configdrivers/of/base.c+0 -30 replies
2/6of: remove struct property.unique_id for FDTinclude/linux/of.h+2 -01 reply
3/6of: make struct property _flags field configurableinclude/linux/of.h+4 -00 replies
4/6of: move kobj_to_device_node() into dynamic.cdrivers/of/dynamic.c drivers/of/of_private.h+5 -60 replies
5/6of: wrap accesses to device_node kobjectdrivers/base/core.c include/linux/of.h+3 -11 reply
6/6of: make kobject and bin_attribute support configurabledrivers/of/Kconfig drivers/of/Makefile drivers/of/base.c +4 more+202 -1640 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchGreg Kroah-HartmanGrant LikelyNicolas PitreFrank Rowand
SeriesT-b R-b
1/6
2/6A-b
3/6
4/6
5/6A-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/6] Shrinking DT memory usage

On kernels with a minimal config and a RAM target in the 100s of KB, DT is quite a hog of runtime memory usage. How much is dependent on how many nodes and properties in the DT which have a corresponding struct device_node and struct property in the kernel. Just skipping disabled nodes saves a lot by not creating the device_nodes in the first place[1], but there's more low hanging fruit by making some of the fields in struct property and struct device_node optional. With the changes here, the memory usage goes from 17KB to under 8KB on QEMU's ARM virt machine which is a relatively small DT.

The majority of the diffstat here is just moving all the kobject/sysfs related code to its own file so we can avoid adding a bunch of ifdefs.

There's more drastic approaches we could take such as doing the unflattening at build time and storing the bulk of the unflattened tree as const data. Grant also has some ideas on storing properties as ids instead. He's explained it to me, but I still don't understand it.

Rob

[1] https://patchwork.kernel.org/patch/9983203/

Rob Herring (6):
of: fix missing kobject init for !SYSFS && OF_DYNAMIC config
of: remove struct property.unique_id for FDT
of: make struct property _flags field configurable
of: move kobj_to_device_node() into dynamic.c
of: wrap accesses to device_node kobject
of: make kobject and bin_attribute support configurable

 drivers/base/core.c     |   2 +-
 drivers/of/Kconfig      |   4 ++
 drivers/of/Makefile     |   1 +
 drivers/of/base.c       | 133 ---------------------------------------
 drivers/of/dynamic.c    |  27 ++------
 drivers/of/kobj.c       | 164 ++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/of/of_private.h |  29 +++++++--
 include/linux/of.h      |  28 +++++----
 8 files changed, 215 insertions(+), 173 deletions(-)
 create mode 100644 drivers/of/kobj.c
Signature · 6 lines
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html