All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Nicolas Pitre <nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Grant Likely <glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Subject: Re: [PATCH 0/6] Shrinking DT memory usage
Date: Fri, 6 Oct 2017 19:11:37 -0700	[thread overview]
Message-ID: <59D837D9.1080203@gmail.com> (raw)
In-Reply-To: <20171005194422.26224-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On 10/05/17 12:44, Rob Herring wrote:
> 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
> 

For the entire series:

Reviewed-by: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

I don't know if there will be any conflicts between my series
"[PATCH 00/12] of: overlay: clean up device tree overlay code"
and this series.

If you choose to apply this series first, I will make any needed
changes to my series.

-Frank
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Frank Rowand <frowand.list@gmail.com>
To: Rob Herring <robh@kernel.org>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Cc: Nicolas Pitre <nico@linaro.org>, Grant Likely <glikely@secretlab.ca>
Subject: Re: [PATCH 0/6] Shrinking DT memory usage
Date: Fri, 6 Oct 2017 19:11:37 -0700	[thread overview]
Message-ID: <59D837D9.1080203@gmail.com> (raw)
In-Reply-To: <20171005194422.26224-1-robh@kernel.org>

On 10/05/17 12:44, Rob Herring wrote:
> 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
> 

For the entire series:

Reviewed-by: Frank Rowand <frowand.list@gmail.com>

I don't know if there will be any conflicts between my series
"[PATCH 00/12] of: overlay: clean up device tree overlay code"
and this series.

If you choose to apply this series first, I will make any needed
changes to my series.

-Frank

  parent reply	other threads:[~2017-10-07  2:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 19:44 [PATCH 0/6] Shrinking DT memory usage Rob Herring
2017-10-05 19:44 ` Rob Herring
2017-10-05 19:44 ` [PATCH 2/6] of: remove struct property.unique_id for FDT Rob Herring
2017-10-06 13:30   ` Grant Likely
2017-10-05 19:44 ` [PATCH 3/6] of: make struct property _flags field configurable Rob Herring
2017-10-05 19:44 ` [PATCH 4/6] of: move kobj_to_device_node() into dynamic.c Rob Herring
2017-10-05 19:44 ` [PATCH 5/6] of: wrap accesses to device_node kobject Rob Herring
     [not found]   ` <20171005194422.26224-6-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-10-06 10:09     ` Greg Kroah-Hartman
2017-10-06 10:09       ` Greg Kroah-Hartman
2017-10-05 19:44 ` [PATCH 6/6] of: make kobject and bin_attribute support configurable Rob Herring
2017-10-06 13:55 ` [PATCH 0/6] Shrinking DT memory usage Grant Likely
2017-10-06 21:30 ` Nicolas Pitre
     [not found]   ` <nycvar.YSQ.7.76.1710061726330.1834-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2017-10-06 22:10     ` Rob Herring
2017-10-06 22:10       ` Rob Herring
     [not found]       ` <CAL_JsqLDhf2tx5PHAnY9X3ju42BayVmJ1KONoKFhhbSaxaKGHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-06 23:24         ` Nicolas Pitre
2017-10-06 23:24           ` Nicolas Pitre
     [not found] ` <20171005194422.26224-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-10-05 19:44   ` [PATCH 1/6] of: fix missing kobject init for !SYSFS && OF_DYNAMIC config Rob Herring
2017-10-05 19:44     ` Rob Herring
2017-10-07  2:11   ` Frank Rowand [this message]
2017-10-07  2:11     ` [PATCH 0/6] Shrinking DT memory usage Frank Rowand

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=59D837D9.1080203@gmail.com \
    --to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.