This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: unassigned at bugs dot ecos dot sourceware dot org
- Date: Sat, 26 May 2012 16:46:11 +0100
- Subject: [Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
- Auto-submitted: auto-generated
- References: <bug-1001591-777@http.bugs.ecos.sourceware.org/>
Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001591
Jonathan Larmour <jifl@ecoscentric.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jifl@ecoscentric.com
AssignedTo|unassigned@bugs.ecos.source |jifl@ecoscentric.com
|ware.org |
--- Comment #1 from Jonathan Larmour <jifl@ecoscentric.com> 2012-05-26 16:46:10 BST ---
(In reply to comment #0)
> The jffs2_find_gc_block function in fs/jffs2/current/src/gc.c and
> jffs2_mark_node_obsolete in nodemgmt.c try to do pseudo-random stuff by
> computing jiffies % 128 and making probability decisions on the result. First I
> think that this kind of pseudo-randomness is not really correct for embedded
> systems that often have very predictable execution times.
>
> But what is much worse, compat/linux/current/include/linux/kernel.h defines
> jiffies as
> #define jiffies 100
>
> I am no expert at jffs2 and cannot say whether this can lead to major problems
> or not, so I'd like someone with better understanding of jffs2 to look at it.
Yes. It's a problem but not a big one. It just means it loses an element of
pseudo-randomness which means that with certain repetitive usage patterns,
there may be uneven flash wear. I'll fix this to use cyg_current_time() which
is close enough to achieve the same job.
> Also check other usage of jiffies - I found one more in
> io/usb/eth/slave/current/host/ecos_usbeth.c
That file is genuinely for Linux so that's ok.
Jifl
--
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.