[mythtv] Proposed change to disk scheduler

Yeechang Lee ylee at pobox.com
Sat Jul 28 10:04:56 UTC 2012


I opened ticket #10946 because of an inconsistency I found with the
behavior of the Combination disk scheduler versus the Wiki
documentation
(http://www.mythtv.org/wiki/Storage_Groups#Balanced_Free_Space).

I then looked at the code (on 0.24.3, but I presume it hasn't changed
since) in mythbackend/scheduler.cpp, and understood why the behavior I
discuss in the ticket, which Jon Larson also reported in 2008, occurs
despite my setting SGweightLocalStarting to 0. Why does
comp_storage_combination() have hard-wire checks for local versus
remote filesystems? Isn't that what SGweightLocalStarting is for?

I patched scheduler.cpp with the following:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-10946.diff
Type: application/octet-stream
Size: 708 bytes
Desc: Disk I/O scheduler patch for 0.24
URL: <http://www.mythtv.org/pipermail/mythtv-dev/attachments/20120728/630aa7f9/attachment.obj>
-------------- next part --------------

I modified comp_storage_disk_io() assuming that there is no reason to
not consider disk space if weights are otherwise equal. In effect, it
is Combination without the hardwired local/remote filesystem
differentiation. On my system I use SGweightLocalStarting = 0 because
I prefer to not distinguish between local and remote, but without the
manual setting the patched scheduler will prefer local over remote
storage depending on the situation.

Is the patch better added as a new, fourth disk scheduler? Or perhaps
replace comp_storage_combination() entirely? I realize Combination is
the legacy disk scheduler created long before the two others appeared,
and (thankfully) is no longer the default anyway, so there may not be
interest in changing it now. I nonetheless believe that the behavior I
discuss in the ticket--of having the scheduler consider both weight
and free space, with the ability to control how much a filesystem's
location affects affects the likelihood of its usage--is desirable,
especially given that the average number of tuners is slowly growing
thanks to CableCARD tuners and wider use of multirec.


More information about the mythtv-dev mailing list