zephyr/subsys
Michael Scott 6ef46e3f31 net: lwm2m: remove attr_list from obj, obj_inst and res_inst structs
The slist attr_list doesn't scale well when added to the LwM2M object,
object instance and resource instance structures.  The goal of a
robust LwM2M client is to let the user create MANY object instances
and these will have many resource instances each.  The amount of SRAM
taken up by the attr_lists will only increase over time, regardless
of the actual # of write attribute structures reserved via the
LWM2M_NUM_ATTR config setting.

Instead, let's remove the slist from these structures and add a
reference pointer to the lwm2m_attr structure.  We can use this
reference to create the one to many relationship between the objects,
object instances and resource instances for a much smaller amount of
code and SRAM resources.

The sacrifice for these savings will be a larger # of iterations when
looking up assigned write attributes and matching them to their
references.  However, due to the # of write attributes current being
handled, the # of iterations during this process is very manageable.

Example flash and SRAM savings when building for nrf52_blenano2:
Before patch:
Memory region         Used Size  Region Size  %age Used
           FLASH:      139532 B       512 KB     26.61%
            SRAM:       36576 B        64 KB     55.81%
        IDT_LIST:         148 B         2 KB      7.23%

After patch:
Memory region         Used Size  Region Size  %age Used
           FLASH:      139284 B       512 KB     26.57%
            SRAM:       36000 B        64 KB     54.93%
        IDT_LIST:         148 B         2 KB      7.23%

Summary: This patch saves ~248 bytes of flash and ~576 bytes of SRAM
for the typical configuration of LwM2M client in Zephyr.

NOTE: these values will vary by architecture.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-05-11 16:38:49 +03:00
..
bluetooth Bluetooth: GATT: Add support to persistent CCC config 2018-05-11 14:55:42 +03:00
console
cpp kconfig: Move CPLUSPLUS from root to "Compiler Options" 2018-04-30 13:12:01 -04:00
debug subsys: debug: Fix stack sentinel dependencies 2018-05-10 14:16:46 -07:00
dfu
disk subsys: disk: Add support for multiple disk interfaces 2018-05-08 08:53:01 -04:00
fs subsys: fs: Add the support for multiple instances of fs 2018-05-08 08:53:01 -04:00
logging syslog: net: Fix multiple network interface selection for IPv4 2018-04-13 08:29:44 -04:00
mgmt mgmt: Switch to new base64 library 2018-03-23 05:18:11 -04:00
net net: lwm2m: remove attr_list from obj, obj_inst and res_inst structs 2018-05-11 16:38:49 +03:00
random
settings susbsys: settings: optimized fcb compression for deleted entry 2018-05-11 09:56:52 +02:00
shell shell: kernel: Add reboot command 2018-04-25 07:18:35 +05:30
storage subsys: fs: fix generic storage partition selection 2018-05-04 10:14:01 -04:00
usb usb: dfu: fix 'this area can not be overwritten' 2018-05-10 16:26:38 -07:00
CMakeLists.txt subsys: Add a new settings subsystem 2018-03-28 10:44:20 -04:00
Kconfig kconfig: Move CPLUSPLUS from root to "Compiler Options" 2018-04-30 13:12:01 -04:00