You are not logged in.

#1 2012-08-08 11:11:34

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

ck patch for kernel 3.4.6+

From kernel 3.4.6, when using ck patch with dynamic ticks option enabled, there will be the following error:
LD init/built-in.o
LD .tmp_vmlinux1
kernel/built-in.o: In function `tick_nohz_stop_sched_tick.isra.9':
tick-sched.c:(.text+0x49c29): undefined reference to `calc_load_enter_idle'
kernel/built-in.o: In function `tick_nohz_idle_exit':
(.text+0x49fa7): undefined reference to `calc_load_exit_idle'
make: *** [.tmp_vmlinux1] Error 1

To solve this problem, I found that simply removing the two lines(calc_load_enter_idle() and calc_load_exit_idle()) from tick-sched.c works. I guess that these two function is used for matching with the new core.c, but bfs.c does not have any changes. So, tick-sched.c need not be changed. Deleting the call of the functions(ie make it become tick-sched.c in 3.4.5) MAY not cause problems(I am not sure).

I am now using that kernel. Everything works great! Would anyone like to try?

Edit: trying using this patch instead of patch-3.4-ck3: http://db.tt/bd1jZ6T2

Last edited by qpalz (2012-08-08 14:35:35)

Offline

#2 2012-08-08 11:36:11

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: ck patch for kernel 3.4.6+

You could check what pf does.

Offline

#3 2012-08-08 11:47:18

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

brebs wrote:

You could check what pf does.

Well, how can it be able to solve the problem? Although I have not really compile the kernel with this patch, AFAIK, there should be the same error.(maybe I am lacking in knowledge) This patch does not provide calc_load_enter_idle and calc_load_exit_idle in bfs.c. core.c, which provides these two function, is disabled. But tick-sched.c still uses these two functions. Errors should happen.

Offline

#4 2012-08-08 11:59:56

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: ck patch for kernel 3.4.6+

qpalz wrote:

But tick-sched.c still uses these two functions. Errors should happen.

No it doesn't. With pf 3.4.6:

$ cd /usr/src/linux/kernel/time
$ grep calc_load tick-sched.c
<nothing>

Offline

#5 2012-08-08 12:12:15

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

brebs wrote:
qpalz wrote:

But tick-sched.c still uses these two functions. Errors should happen.

No it doesn't. With pf 3.4.6:

$ cd /usr/src/linux/kernel/time
$ grep calc_load tick-sched.c
<nothing>

So terrible, I cannot find anything about tick-sched.c, calc_load_enter_idle or calc_load_exit_idle in the patch file. Why does tick-sched.c change?
PS: There are many errors when I apply the patch to 3.4.7.

Offline

#6 2012-08-08 12:14:50

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: ck patch for kernel 3.4.6+

Apply pf's patch to vanilla kernel 3.4 - it's that simple.

Offline

#7 2012-08-08 12:27:30

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

brebs wrote:

Apply pf's patch to vanilla kernel 3.4 - it's that simple.

I know what happens now. You apply the patch to vanilla kernel 3.4. tick-sched.c in kernel 3.4 does not contain calc_load_enter_idle or calc_load_exit_idle. It appears from 3.4.6. That's why you can't find it.

Offline

#8 2012-08-08 13:26:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: ck patch for kernel 3.4.6+

@op - this is a known bug in bfs 0.424.

See my comments for 3.4.6-1 in the linux-ck changelog: https://wiki.archlinux.org/index.php/Linux-ck/Changelog

Offline

#9 2012-08-08 14:14:11

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

graysky wrote:

@op - this is a known bug in bfs 0.424.

See my comments for 3.4.6-1 in the linux-ck changelog: https://wiki.archlinux.org/index.php/Linux-ck/Changelog

I know that. I just want to say that my solution should work.
Trying using this patch instead of patch-3.4-ck3: http://db.tt/bd1jZ6T2

Last edited by qpalz (2012-08-08 14:35:53)

Offline

#10 2012-08-08 14:45:56

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: ck patch for kernel 3.4.6+

You should email your patch to ck for review.  Might help him as is ports bfs to the 3.5 tree.

Offline

#11 2012-08-08 15:03:13

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

graysky wrote:

You should email your patch to ck for review.  Might help him as is ports bfs to the 3.5 tree.

I have emailed to ck. Waiting for his review and reply. Hope this helps him.

Offline

#12 2012-08-08 15:18:02

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: ck patch for kernel 3.4.6+

@qpalz - Cool, thanks.  You wanna take a crack at porting bfs v0.424 into the 3.5 tree?  Below is a link to the linux-ck package for 3.5.0 (without bfs obviously) should you wanna give it a go.

http://repo-ck.com/PKG_source/linux-ck- … src.tar.gz

Offline

#13 2012-08-09 02:17:26

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

graysky wrote:

@qpalz - Cool, thanks.  You wanna take a crack at porting bfs v0.424 into the 3.5 tree?  Below is a link to the linux-ck package for 3.5.0 (without bfs obviously) should you wanna give it a go.

http://repo-ck.com/PKG_source/linux-ck- … src.tar.gz

I am not a good and professional kernel hacker... I can only do something relatively simpiler.
I may try, but obviously I will fail. sad

Edit:
Here is a port of bfs to kernel 3.5 by _sid_: http://ck-hack.blogspot.hk/2012/07/bfs- … 4000555384
But after applying your patch, there is the following error when compiling:
kernel/sched/bfs.c: In function 「sd_init_ALLNODES」:
kernel/sched/bfs.c:6233:1: Error: 「SD_ALLNODES_INIT」 undeclared (first use in this function)
kernel/sched/bfs.c:6233:1: Note: each undeclared identifier is reported only once for each function it appears in
kernel/sched/bfs.c: In function 「sd_init_NODE」:
kernel/sched/bfs.c:6234:1: Error: 「SD_NODE_INIT」 undeclared (first use in this function)

Last edited by qpalz (2012-08-10 11:36:36)

Offline

#14 2012-08-10 03:50:48

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

This patch still works in kernel 3.4.8.

Offline

#15 2012-08-10 13:12:37

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,696

Re: ck patch for kernel 3.4.6+

Moved, per request


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#16 2012-08-11 12:29:20

qpalz
Member
From: Hong Kong
Registered: 2012-08-08
Posts: 18

Re: ck patch for kernel 3.4.6+

Here is a patch of bfs for kernel 3.5 and 3.5.1 by _sid_: http://ck-hack.blogspot.com/2012/07/bfs … 3793717593

And, I have merged it into ck patch. (I have actually done nearly nothing...)
I have tested that ck patch for 3.5 and 3.5.1. It seems working well but no guarantees for you.

You may get the patch here: http://db.tt/FE90YOnx

Edit:
This patch is quite unstable in KDE but I works well in console. This may be caused by the low resource usage in console. When the resource usage is high, problems occur.

Edit2:
A new patch with new bfs ported to 3.5 and some fix by me: http://db.tt/8RuzEw99
Works well in both console and KDE. Quite stable but no guarantees.

Last edited by qpalz (2012-08-13 05:31:30)

Offline

Board footer

Powered by FluxBB