Skip to contentSkip to conversation

2.6 preemptive kernel on mips

DISCUSSION Song Wang 5 participants 7 messages Aug 3, 2004 – Oct 5, 2004 MIPS

lore
Share & tools
lore

Song Wang

author
#0 lore raw

Hi,

Has anyone tried to enable kernel preemption on
Linux mips 2.6 kernel (mips32) and test it? If
so, which version does it work?

I tried on 2.6.3 and it didn't work.

Thanks.

-Song

__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail

#1 lore raw
Quoted 8 lines · Song Wang

Hi,

Has anyone tried to enable kernel preemption on
Linux mips 2.6 kernel (mips32) and test it? If
so, which version does it work?

I tried on 2.6.3 and it didn't work.

Try the latest kernel. I checked preemption around 2.6.5 time and I believe all the obvious problems are fixed then.

There are still some issues with both SMP and PREEMPT, but most people won't see them in normal cases.

Jun

#2 lore raw
Quoted 7 lines · Jun Sun
Quoted 6 lines · Song Wang

Hi,

Has anyone tried to enable kernel preemption on
Linux mips 2.6 kernel (mips32) and test it? If
so, which version does it work?

Quoted 8 lines
Quoted 2 lines

I tried on 2.6.3 and it didn't work.

Try the latest kernel. I checked preemption around 2.6.5 time and I believe all the obvious problems are fixed then.

There are still some issues with both SMP and PREEMPT, but most people won't see them in normal cases.

MIPS or generic? It's claimed, at least, that SMP&&PREEMPT have no fatal, generic, issues now (I forget if that was the case around 2.6.5).

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#3 lore raw
Quoted 12 lines · Tom Rini
Quoted 10 lines · Jun Sun
Quoted 8 lines · Song Wang

Hi,

Has anyone tried to enable kernel preemption on
Linux mips 2.6 kernel (mips32) and test it? If
so, which version does it work?

I tried on 2.6.3 and it didn't work.

Quoted 9 lines
Quoted 5 lines

Try the latest kernel. I checked preemption around 2.6.5 time and I believe all the obvious problems are fixed then.

There are still some issues with both SMP and PREEMPT, but most people won't see them in normal cases.

MIPS or generic? It's claimed, at least, that SMP&&PREEMPT have no fatal, generic, issues now (I forget if that was the case around 2.6.5).

It is MIPS specific problems I was referring to (such as unsafe smp_processor_id() reference etc).

If you think about it the real problem is that kernel has non-migratable regions, a section where process should not migrate from one CPU to another. Before preemtible kernel is introduced such non-migratable regions are not a problem because they can't migrate during those regions.

So a potentially better solution is to introduce non-migratable regions during which scheduler promises not to migrate the processes. Under such promises a process can actually be preempted while it is in such a region.

Jun

#4 lore raw
In reply to Jun Sun
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jun Sun

jsun> Try the latest kernel. I checked preemption around 2.6.5 time jsun> and I believe all the obvious problems are fixed then.

Hi. Now I'm looking current (2.6.9-rc1) code.

It lacks some preempt_disable/preempt_enable which were in preempt-patch for 2.4 kernel. Are these all unnecessary at all?

For example, fpu-emulation is not preemptive-safe, isn't it?

---
Atsushi Nemoto

#5 lore raw
Quoted 9 lines · Atsushi Nemoto
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jun Sun

jsun> Try the latest kernel. I checked preemption around 2.6.5 time jsun> and I believe all the obvious problems are fixed then.

Hi. Now I'm looking current (2.6.9-rc1) code.

It lacks some preempt_disable/preempt_enable which were in preempt-patch for 2.4 kernel. Are these all unnecessary at all?

They are necessary.

Quoted 2 lines

For example, fpu-emulation is not preemptive-safe, isn't it?

That is correct.

I think the best thing to do right now is to go through 2.4 preemption patch and pick up the missing ones for 2.6.

It will probably take me a little given other things on my hand. I strongly enourage someone else to take a shoot at it. The latest 2.4 MIPS preemption patch seems to be

http://linux.junsun.net/patches/oss.sgi.com/experimental/030304-b.preempt-mips.patch

Jun

#6 lore raw
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jun Sun

It lacks some preempt_disable/preempt_enable which were in preempt-patch for 2.4 kernel. Are these all unnecessary at all?

jsun> They are necessary.

Quoted 1 line
Quoted 1 line

For example, fpu-emulation is not preemptive-safe, isn't it?

jsun> That is correct.

jsun> I think the best thing to do right now is to go through 2.4 jsun> preemption patch and pick up the missing ones for 2.6.

Thank you. I think there are some issue to fix.

1. ll/sc emulation (ll_bit, ll_task). This is easy to fix.

2. There is an global variable ieee754_csr in math-emu. This must be protected by preempt_disable. But math-emu uses put_user/get_user which can not be used with preempt disabled. (Is it true?)

3. save_fp_context/restore_fp_context is not preemptable. But these function uses put_user/get_user.

Actually, math-emu/fp_context issues are not only for preemptive kernel. I suppose bad things can happen if a process going to sleep on get_user/put_user in math-emu/save_fp_context/restore_fp_context...

---
Atsushi Nemoto