Skip to contentSkip to conversation

Feedback on preemptible kernel patch

SMP lock BUG? Manfred Spraul 2 participants 3 messages Sep 8, 2001 – Sep 9, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines

This is interesting. [Assumes UP Athlon - correct]
Note that all BUGs out in highmem.h:95 (kmap_atomic) and that test is only on if you have enabled HIGHMEM_DEBUG [my analyze is done with a 2.4.10-pre2 kernel, but I checked with later patches and I do not think they fix it either...]

The preemptive kernel puts more SMP stress on the kernel than running with multiple CPUs.

So this might be a potential bug in the kernel proper, running with a SMP computer.

No.
It seems to be a missing ctx_sw_off() in highmem.h:
kmap_atomic uses a per-cpu variable, thus ctx_sw_off() is needed in kmap_atomic, and ctx_sw_on() in kunmap_atomic().

--
Manfred

#1 lore raw
Quoted 4 lines · Manfred Spraul

No.
It seems to be a missing ctx_sw_off() in highmem.h:
kmap_atomic uses a per-cpu variable, thus ctx_sw_off() is needed in kmap_atomic, and ctx_sw_on() in kunmap_atomic().

in my tree, kmap_atomic and kunmap_atomic are just defined to kmap/kunmap. are you suggesting something like this?

#define kmap_atomic(page,idx) ctx_sw_off(); kmap(page);
#define kunmap_atomic(page,idx) ctx_sw_on(); kunmap(page);

Signature · 3 lines
Robert M. Love
rml at ufl.edu
rml at tech9.net
#2 lore raw
In reply to Manfred Spraul
Quoted 4 lines

#define kmap_atomic(page,idx) ctx_sw_off(); kmap(page); #define kunmap_atomic(page,idx) ctx_sw_on(); kunmap(page);

No. kmap_atomic is called from interrupt context, and kmap calls schedule().

I thought about the attached patch (completely untested).

--
Manfred