Wednesday, April 29, 2015

VRQ 0.4 update for linux-4.0.y

There are three major feature in this VRQ branch

1. VRQ lock strategy update, replace grq lock strategy with task_access lock strategy
    That is
* lock on rq->lock when task is on cpu
* lock on grq.lock when task is in queue
* otherwise lock on task's pi_lock

    It's the most huge changes which impact almost the whole scheduler code. Based on this, there are some grq lock sessions improvements are made for activate and idle task schedule.

2. preempt task solution
    This is an enhancement for try_to_wake_up(), instread of putting the wake up task in grq and reschedule a cpu/rq to pick it up, the woken task now becomes the preempt task in the rq and be picked immeditly in next schedule run, this save the effect to put/get the task from grq and avoid other cpus/rqs to access grq.

3. cache_count solution
    Introduce cache_count for task, which indicate cache hot when task waiting in queue. This replaces sticky task solution in BFS.
    Current setting 14 for activate tasks and 4 for deactivate tasks are both tested values. In future version, algorithm will based on more meaningful factors.


REMARKABLE NOTICE:
1. SMT_NICE code is kept but is not tested, don't enable it for VRQ yet.
2. yield_to() locking is unchanged and not tested, so kvm may not work.
3. UP is not tested, and VRQ is not designed for UP, don't try it on VRQ.
4. Based on user reports, VRQ may not work with some kernel config, but it's unknow which config is causing the issue. Further testing still needed.
5. Try VRQ if you want to help testing, if it runs good, keep using it, if not, fall back to the -gc branch.



Enjoy and have fun.

BR Alfred

Update:
Found an issue by investigating Manuel's config, a quick workaround is set NR_CPUS to exact core number of your system. A fix will be in for 0.5 release.

Sunday, April 26, 2015

linux-4.0.y-gc updates

All needed patches are set, here are the changes

BFS:
1. Add a [Sync] patch for 0462, that is bfs: [Sync] __schedule() and io_schedule_timeout()
2. bfs: [Sync] sched_setscheduler() logic, v2
*Refine the code in check_task_change()
3. bfs: [3/3] priodl to speed up try_preempt(), V2
*V2 rq's priodl store in grq.rq_priodls array, for 32bits system, grq.priodl_lock needs to be held for r/w.
4. bfs: Full cpumask based and LLC sensitive cpu selection, V2
* V2 Fix issue when SMP config enabled, but non of SMT or MC config is
enabled.
* Add enhancement code for cpu hotplug, for the case the cpu is idle when it goes offline, which will cause grq.cpu_idle_map still be set.

Others:
Remove the patch for IBM thinkpad KB, upstream has fixed the issue.

Link location

Have fun with linux 4.0

BR Alfred

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.

https://bitbucket.org/alfredchen/linux-gc/downloads/bfs0461_linux4.0_syncup.patch

Monday, April 13, 2015

BFS fun for Raspberry Pi 2

Recently I brought a Raspberry Pi 2 as there are 4 cores than the single one on the first generation and double ram size. I would like to check whether it can be a thin-client replacement for me at this moment and for sure, Pi is very extendable and a fun toy to play with, I already have several idea want to be made from Pi.

After try with the NOOB to make sure the hardware works, I installed funtoo into Pi, system runs fine, X works with FB driver, FF 31 can be compiled and works, but it runs slow than I expected. I may try Xorg rpi driver to see if it acts better. But before that, I tried to custom the pi kernel for my needs and of course, get BFS run on it.

Pi now using 3.18.x kernel, the default pi kernel conig is a little be "fat", I am not going to customize the kernel config heavily right now, as it's the first time to touch this arch. Changed two kernel config to my needed, rebuild the kernel and it works on Pi. BFS 0460 can be clearly applied and be built, the kernel is running for 8H now. So far, BFS on Pi2 goes smoothly, going to apply -gc branch onto it, to be continued...


Thursday, April 2, 2015

Pre-release of VRQ 0.4

Here comes the vrq patch up on the latest -gc branch.

https://bitbucket.org/alfredchen/linux-gc/downloads/vrq_upon_3.19-gc.patch

As a pre-release, I don't want add details here, just want to know if it works for you and don't expect improvement comparing to -gc branch, based on my sanity test, it just can match the -gc branch at this moment.

I will continue do some code cleanup and tune before formal release.