This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Feature requests · Rockbox frontpage
FS#8568 - backrolling spinlock changes (svn 16105)
Attached to Project:
Rockbox
Opened by Andree Buschmann (Buschel) - Saturday, 09 February 2008, 17:02 GMT+2
Last edited by Michael Sevakis (MikeS) - Friday, 22 February 2008, 18:30 GMT+2
Opened by Andree Buschmann (Buschel) - Saturday, 09 February 2008, 17:02 GMT+2
Last edited by Michael Sevakis (MikeS) - Friday, 22 February 2008, 18:30 GMT+2
|
DetailsThis patch undos the spinlock changes which came in with svn 16105. With this patch the strange HDD activity on iPod 5G's with 60/80GB HDDs is solved. Furthermore this patch should therefor solve the low battery runtime for these players.
|
This task depends upon
Closed by Michael Sevakis (MikeS)
Friday, 22 February 2008, 18:30 GMT+2
Reason for closing: Fixed
Additional comments about closing: Temporary measure to deal with the specific targets is committed.
Friday, 22 February 2008, 18:30 GMT+2
Reason for closing: Fixed
Additional comments about closing: Temporary measure to deal with the specific targets is committed.
FS#8397? This bug was reported to appear before r16105 was committed.svn pre 16105 came out 20 seconds intensive reading, total spin time of HD was 1:20 minutes.
svn post 16105 came out 1:07 minutes intesive reading, total spin time of HD was 2:30 mintes
i tested up to svn rev 16243 with the same issues as post 16105. Latest SVN (16254) with above patch returned the intense reading to 20 secs, and total spin time to 1:20
1) Why no issue on any other model? I did fix a stupid mistake of mine which did affect many models and sensibly so. I haven't perceived any negative effect on the many players I have whether flash based or HD based. Perhaps we simply have some other "oops" factor at play.
2) This should have no effect at all since a mutex provides no more a barrier to critical section entry and thread execution than the "spinlock". The difference may be a change in thread scheduling which could cause misbehavior due to race conditions.
3) Scheduler turnaround overheads are in the 15-25 microsecond range for even the worst-case of a queue_send to a thread on a timeout wait (PP502x at 80MHz). Hardly significant relative to HD speeds and the rather low 2000 or so read calls to fill the file buffer should at worst add up to a few millseconds. That's _if_ blocking and wakeup is involved.
4) Based on above, does 5g have any particularly time-consuming subsystem that placing a thread at the end of the run list may delay execution of the buffering thread? Changing to insert-next didn't show an effect but that was before fixing the (rather embarrassing) priority_yield mistake.
5) Does MPEGPlayer significantly vary in its buffering behavior with or without this patch? It should be equally if not more adversely affected. Observe the audio buffer fullness indication in "Show FPS".
Perhaps I'll post the change mentioned in 4) here so it may be tested with the other fix in place.
I do not want this patch as final solution. My aim is to kind of repair the svn for the 5G 60/80GB users. You will understand that it is quite hard to do battery runtime tests (which were and are needed for the device disables patch) when the svn degraded that much.
So, why not backrolling the changes in svn to have svn working for all and open an flyspray entry to re-add it and work on the 5G issue? There are several testers available who can (and I think will) support any testing.
With this patch the thread using the disk will be more aggressively run if it was blocked and explicitly woken so it should actually have an advantage over spinlock.
I now get 50 seconds of "buffering" and 2:05 minutes HD spin time. I have been asked several times, why my HD doesn't shut off right after buffering, so I think i should calrify this here.
in the first 20/50/70 seconds (depending on which patch applied) i can hear continous read activity on the HD (the usual "ticking" noise). After that, i can only hear the HD spining. Every 4 or 5 seconds read activity can be heard on the HD for a brief second. That's why the HD shuts down after 1:20/2:05/2:30 respectively
I hope these values are helpfull at all. All values were measured with no background activity (they were measured several times on each patch/build as well, all within +/- 2 seconds)
version: hd activity time, hd spintime
stock: 1:05min 2:10min
stock + ata_priority_realtime: 0:55min 2:05min
stock + ata_priority_realtime + thread_wakeup_insert_first: 0:45min 2:00min
stock + spinlock_rollback_v02 : 0:20min 1:30min
thanks in advance
Horscht
Other work is in progress to deal properly with priorities in general and I could post a patch of that (perhaps under a different FS). It won't have the inheritance protocols yet (maybe) and will be a tiny bit out of tune but the results are quite good for priority in general anyway and I'm curious how it so far affects this problem. The said temp object can be easily and ultimately removed - no fuss, no muss.