Wednesday, April 15, 2015

BFS0461 linux 4.0 syncup patch

Linux 4.0 is released this week. Some expected scheduler fixes are in it, and here is my sync-up patch for BFS0461. For my -gc branch, I am still waiting for the bfq new release and porting bfs related patches from 3.19 to 4.0

Please be noticed that extract __schedule() and sched_submit_work() from schedule() used to cause some issues when ck release similar changes for BFS in 3.18 release, then it is reverted in 0460 for 3.19. Hopefully these are fixed in upstream kernel changes.


  1. Hi, Alfred!
    Many thanks for this sync-up! I haven't tried kernel 4.0.0 yet, as there are too many other patches outstanding, but have added some of the chunks from your patch to my 3.19(.4) setup. These chunks add the missing kernel/sched/core.c code that I wasn't able to safely adapt to bfs.c on my own at the times when kernelOfTruth reported the row of cfs improvement/fix-patches @ ck's blog.
    This 3.19.4, together with your -gc patches, bfq and tuxonice has only few uptime hours so far, but I'm glad not to see any issues.

    Just out of curiosity: What does this chunk change "in real world"?:
    > @@ -4944,9 +4947,10 @@ void sched_show_task(struct task_struct *p)
    > {
    > unsigned long free = 0;
    > int ppid;
    > - unsigned state;
    > + unsigned long state = p->state;
    > - state = p->state ? __ffs(p->state) + 1 : 0;
    > + if (state)
    > + state = __ffs(state) + 1;
    > printk(KERN_INFO "%-15.15s %c", p->comm,
    > state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
    > #if BITS_PER_LONG == 32

    BR Manuel

    1. This is a minor change from main stream. In real world, it does "nothing", :)
      But from the coder's view, I'd like the updated version, it's easy to understand and "may be" a few final instructions saved. But consider the chances sched_show_task() being called, it does "nothing".