 Chromium Code Reviews
 Chromium Code Reviews Issue 
            5254002:
    CHROMIUM: config: enable cgroup-based group scheduling  (Closed)
    
  
    Issue 
            5254002:
    CHROMIUM: config: enable cgroup-based group scheduling  (Closed) 
  | DescriptionCHROMIUM: config: enable cgroup-based group scheduling
Group scheduling can have a dramatic impact on interactive response:
http://www.phoronix.com/scan.php?page=article&item=linux_2637_video
I think a reasonable group scheduling policy for ChromiumOS would be
to put the active tab processes into a "foreground" group and the
backgrounds tabs into a "background" group.
To simulate this, I did the following:
sudo mkdir -p /tmp/cgroup/cpu
sudo mount -t cgroup cgroup /tmp/cgroup/cpu -o cpu
sudo mkdir -m 0777 /tmp/cgroup/cpu/user
cd /tmp/cgroup/cpu/user
mkdir foreground
mkdir background
for i in `ps -ef | grep chrome | grep -v grep | awk '{ print $2 }'`; do
  echo $i > foreground/tasks
done
To simulate background tab processing I used 20 soaker threads:
$ cat busy.c
int main(int argc, char * argv[]) {
  int x = 0;
  while (1) {
    x++;
    if (x % 1000000 == 0) {
      sched_yield();
    }
  }
  return 0;
}
Which I than ran in the background:
echo $$ > background/tasks
for i in `seq 20`; do
  busy &
done
For the non-cgroup test case, I just did:
for i in `seq 20`; do
  busy &
done
Then in the browser I ran the SunSpider 0.9.1 JavaScript benchmark.
Without cgroups (i.e. without this patch) I get:
16954.8ms +/- 1.4%
With cgroups (i.e. this patch) and a background/foreground grouping I get:
2040.3ms +/- 2.0%
So I get an 8.3 X speedup using cgroups!
BUG=9288
TEST=See above.
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Change-Id: I16c87499dfe35ff5b2f5353e68db447b9ce10ddc
Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=a87ecbb
   Patch Set 1 #Patch Set 2 : Rebase to latest kernel. #Messages
    Total messages: 5 (0 generated)
     |