public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
  2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in garbage collect bugzilla-daemon
@ 2012-05-21 13:02 ` bugzilla-daemon
  2012-05-26 15:46 ` bugzilla-daemon
  1 sibling, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2012-05-21 13:02 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001591

Stanislav Meduna <stano@meduna.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Bogus pseudo-randomness in  |Bogus pseudo-randomness in
                   |garbage collect             |jffs2 garbage collect

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


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

* [Bug 1001591] New: Bogus pseudo-randomness in garbage collect
@ 2012-05-21 13:02 bugzilla-daemon
  2012-05-21 13:02 ` [Bug 1001591] Bogus pseudo-randomness in jffs2 " bugzilla-daemon
  2012-05-26 15:46 ` bugzilla-daemon
  0 siblings, 2 replies; 7+ messages in thread
From: bugzilla-daemon @ 2012-05-21 13:02 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001591

           Summary: Bogus pseudo-randomness in garbage collect
           Product: eCos
           Version: CVS
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: major
          Priority: low
         Component: Filesystem support
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: stano@meduna.org
                CC: ecos-bugs@ecos.sourceware.org
             Class: Advice Request


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.

Also check other usage of jiffies - I found one more in
io/usb/eth/slave/current/host/ecos_usbeth.c

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


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

* [Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
  2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in garbage collect bugzilla-daemon
  2012-05-21 13:02 ` [Bug 1001591] Bogus pseudo-randomness in jffs2 " bugzilla-daemon
@ 2012-05-26 15:46 ` bugzilla-daemon
  1 sibling, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2012-05-26 15:46 UTC (permalink / raw)
  To: unassigned

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.


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

* [Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
  2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in " bugzilla-daemon
  2012-05-21 13:02 ` [Bug 1001591] Bogus pseudo-randomness in jffs2 " bugzilla-daemon
  2012-05-26 15:46 ` bugzilla-daemon
@ 2012-05-27  0:53 ` bugzilla-daemon
  2012-05-27  0:53 ` bugzilla-daemon
  3 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2012-05-27  0:53 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001591

--- Comment #2 from Jonathan Larmour <jifl@ecoscentric.com> 2012-05-27 01:52:52 BST ---
Created an attachment (id=1768)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1768)
Make jiffie use cyg_current_time

I've committed the attached patch to fix this issue.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
  2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in " bugzilla-daemon
                   ` (2 preceding siblings ...)
  2012-05-27  0:53 ` bugzilla-daemon
@ 2012-05-27  0:53 ` bugzilla-daemon
  3 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2012-05-27  0:53 UTC (permalink / raw)
  To: ecos-bugs

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
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |NEXTRELEASE

--- Comment #3 from Jonathan Larmour <jifl@ecoscentric.com> 2012-05-27 01:53:31 BST ---
Fixed.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
  2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in " bugzilla-daemon
  2012-05-21 13:02 ` [Bug 1001591] Bogus pseudo-randomness in jffs2 " bugzilla-daemon
@ 2012-05-26 15:46 ` bugzilla-daemon
  2012-05-27  0:53 ` bugzilla-daemon
  2012-05-27  0:53 ` bugzilla-daemon
  3 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2012-05-26 15:46 UTC (permalink / raw)
  To: ecos-bugs

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 on the CC list for the bug.


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

* [Bug 1001591] Bogus pseudo-randomness in jffs2 garbage collect
  2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in " bugzilla-daemon
@ 2012-05-21 13:02 ` bugzilla-daemon
  2012-05-26 15:46 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2012-05-21 13:02 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001591

Stanislav Meduna <stano@meduna.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Bogus pseudo-randomness in  |Bogus pseudo-randomness in
                   |garbage collect             |jffs2 garbage collect

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2012-05-27  0:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in garbage collect bugzilla-daemon
2012-05-21 13:02 ` [Bug 1001591] Bogus pseudo-randomness in jffs2 " bugzilla-daemon
2012-05-26 15:46 ` bugzilla-daemon
  -- strict thread matches above, loose matches on Subject: below --
2012-05-21 13:02 [Bug 1001591] New: Bogus pseudo-randomness in " bugzilla-daemon
2012-05-21 13:02 ` [Bug 1001591] Bogus pseudo-randomness in jffs2 " bugzilla-daemon
2012-05-26 15:46 ` bugzilla-daemon
2012-05-27  0:53 ` bugzilla-daemon
2012-05-27  0:53 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).