mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Documentation: state: add real-world example for stride size calculation
@ 2024-06-12 13:36 Ahmad Fatoum
  2024-06-13  7:04 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-06-12 13:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The usual use of barebox state is to store the bootstate for
bootchooser. Thus change the example to use the minimum size of the
bootstate variable set instead and relate the result to stride size and
partition size.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/user/state.rst | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst
index 9054a3792337..75352302c7ff 100644
--- a/Documentation/user/state.rst
+++ b/Documentation/user/state.rst
@@ -357,9 +357,14 @@ size of a partition).
 
 .. important:: The ``direct`` storage backend needs 8 bytes of additional space
    per *state* variable set for its meta data. Keep this in mind when calculating
-   the stridesize. For example, if your variable set needs 8 bytes, the ``raw``
-   header needs 16 bytes and the ``direct`` storage backend additionally 8 bytes.
-   The full space for one *state* variable set is now 8 + 16 + 8 = 32 bytes.
+   the stridesize. For example, the bootchooser boot state needs 20 bytes for
+   its variables. The ``raw`` header adds 16 bytes and the ``direct`` storage
+   backend adds a further 8 bytes.
+   The full space for one *state* variable set (minimum stride size) is thus
+   20 + 16 + 8 = 44 bytes.
+   The minimum size for the backend partition is then 44 * 3 = 132 bytes.
+   It's a good idea though to increase stride size beyond the minimum to leave
+   some free space for in-place addition of new variables in future.
 
 Circular Storage Backend Redundancy
 ###################################
-- 
2.39.2




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

* Re: [PATCH] Documentation: state: add real-world example for stride size calculation
  2024-06-12 13:36 [PATCH] Documentation: state: add real-world example for stride size calculation Ahmad Fatoum
@ 2024-06-13  7:04 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-06-13  7:04 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 12 Jun 2024 15:36:53 +0200, Ahmad Fatoum wrote:
> The usual use of barebox state is to store the bootstate for
> bootchooser. Thus change the example to use the minimum size of the
> bootstate variable set instead and relate the result to stride size and
> partition size.
> 
> 

Applied, thanks!

[1/1] Documentation: state: add real-world example for stride size calculation
      https://git.pengutronix.de/cgit/barebox/commit/?id=4c296e6a556b (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2024-06-13  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-12 13:36 [PATCH] Documentation: state: add real-world example for stride size calculation Ahmad Fatoum
2024-06-13  7:04 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox