zephyr/doc
Nicolas Pitre e9a47d932c kernel: mmu: shrink and align struct z_page_frame
The struct z_page_frame is marked __packed to avoid extra padding as
such padding may represent significant memory waste when lots of page
frames are used. However this is a bad strategy.

The code contained this somewhat dubious comment and code in
free_page_frame_list_put():

	/* The structure is packed, which ensures that this is true */
	void *node = pf;
	sys_slist_append(&free_page_frame_list, node);

This is bad for many reasons:

- type checking is completely bypassed;

- if the sys_snode_t node member is no longer located at the front of
  struct z_page_frame then the code will still compile and possibly run
  but be broken with memory corruption as a likely outcome;

- the sys_slist_append() code is completely unaware of the packed
  attribute which breaks architectures with alignment restrictions.

Let's improve code efficiency as well as memory usage by removing the
packed attribute and manually packing the flags in the unused virtual
address bits. This way the page frame array remains naturally aligned,
data access becomes optimal and the actual array size gets even smaller.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-05-13 16:04:40 -04:00
..
_doxygen include/zephyr: Add 'version' and 'since' tag to groups 2024-03-19 13:13:45 +01:00
_extensions/zephyr doc: _extensions: support snippets option 2024-03-26 11:14:46 -05:00
_scripts docs: Bluetooth: Audio: Move audio related files to subdir 2024-05-02 16:51:03 +02:00
_static doc: Make search engine configurable 2023-12-15 04:34:48 -05:00
_templates doc: Make search engine configurable 2023-12-15 04:34:48 -05:00
build doc: sysbuild: Fix namespace example 2024-05-07 15:22:05 -05:00
connectivity doc: net: Add HTTP server documentation 2024-05-10 14:43:38 -05:00
contribute doc: eSPI: Update link to eSPI spec 2024-05-02 13:56:46 -04:00
develop doc: ci: Zephyr now requires Python 3.10 or higher 2024-05-06 14:56:08 +01:00
hardware doc: eSPI: Update link to eSPI spec 2024-05-02 13:56:46 -04:00
images
introduction bluetooth: mesh: Doc fix Bluetooth mesh to Mesh 2023-12-01 10:56:18 +00:00
kernel kernel: mmu: shrink and align struct z_page_frame 2024-05-13 16:04:40 -04:00
project doc: fix typo in multiple directories (build, hardware, kernel, project) 2024-01-26 13:16:18 +01:00
releases doc: migration: 3.7: Add missing links to GitHub Pull Requests 2024-05-13 16:04:11 -04:00
safety
security doc: security: CVE-2024-3077 left embargo 2024-04-04 12:22:57 -04:00
services doc: posix: add links and make minor corrections 2024-05-07 21:22:56 -04:00
templates
404.rst
CMakeLists.txt
conf.py doc: generate sitemap.xml 2024-04-03 12:34:04 +03:00
glossary.rst doc: add board terminology section to board porting guide 2024-03-20 13:00:55 +01:00
index-tex.rst doc: pdf: Add Glossary of Terms to PDF output 2023-11-13 12:17:51 -05:00
index.rst
kconfig.rst
known-warnings.txt
LICENSING.rst docs: licensing: update list of 3rd party code licensed under GPL 2024-02-23 18:27:32 +01:00
Makefile
requirements.txt doc: Relax Sphinx pip dependency 2024-05-06 14:56:08 +01:00
substitutions.txt
zephyr.doxyfile.in doc: expand ZTEST macros in doxygen 2024-04-23 21:46:38 +00:00