Skip to content

Commit

Permalink
Allow the Disk I/O Storage Group scheduler to fallback to free space
Browse files Browse the repository at this point in the history
The "Balanced Disk I/O" Storage Group scheduler was indeterminate when
the weights of two filesystems were equal.  This commit makes that
decision more determinate by allowing the scheduler to fall back to using
the amount of free space on the filesystems to make the decision when
two filesystems have the same weight.

Closes #10946.

Signed-off-by: Chris Pinkham <cpinkham@mythtv.org>
  • Loading branch information
y-lee authored and cpinkham committed Jun 21, 2013
1 parent 06b28fe commit 8876503
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mythtv/programs/mythbackend/scheduler.cpp
Expand Up @@ -4502,11 +4502,19 @@ static bool comp_storage_free_space(FileSystemInfo *a, FileSystemInfo *b)
return false;
}

// prefer dirs with less weight (disk I/O) over dirs with more weight
// prefer dirs with less weight (disk I/O) over dirs with more weight.
// if weights are equal, prefer dirs with more absolute free space over less
static bool comp_storage_disk_io(FileSystemInfo *a, FileSystemInfo *b)
{
if (a->getWeight() < b->getWeight())
{
return true;
}
else if (a->getWeight() == b->getWeight())
{
if (a->getFreeSpace() > b->getFreeSpace())
return true;
}

return false;
}
Expand Down

0 comments on commit 8876503

Please sign in to comment.