Hello.So, just "if (in_atomic()) return;" check is insufficient for detecting all cases when it is not permitted to sleep. I see. Is "in_atomic() returns false inside spinlock on non-preemptible kernels." the only case that the in_atomic() can't tell whether it is permitted to sleep or not? If this is the only case, can't we somehow know it by remembering "how many spinlocks does this CPU is holding now" since "it is not permitted to sleep inside the spinlock" means "the CPU the current process is running will not change". Something like #ifdef CONFIG_COUNT_SPINLOCKS_HELD atomic_t spinlock_held_counter[NR_CPUS]; #endif void spin_lock(x) { /* obtain this spinlock. */ #ifdef CONFIG_COUNT_SPINLOCKS_HELD /* increment spinlock_held_counter[this_CPU]. */ #endif } void spin_unlock(x) { #ifdef CONFIG_COUNT_SPINLOCKS_HELD /* decrement spinlock_held_counter[this_CPU]. */ #endif /* release this spinlock. */ } bool in_spinlock() { #ifdef CONFIG_COUNT_SPINLOCKS_HELD /* return spinlock_held_counter[this_CPU] != 0. */ #else return false; #endif } and use "if (in_atomic() || in_spinlock()) return;" instead of "if (in_atomic()) return;" ? --
| Ryan Hope | reiser4 for 2.6.27-rc1 |
| Ingo Molnar | Re: 2.6.24-rc6-mm1 |
| Tim Tassonis | reiser4 for 2.6.27-rc1 |
| Ingo Molnar | Re: [patch] MTD: fix DOC2000/2001/2001PLUS build error |
git: | |
| Petko Manolov | git and binary files |
| Wink Saville | Resolving conflicts |
| Ken Pratt | pack operation is thrashing my server |
| Junio C Hamano | What's cooking in git.git (Aug 2008, #07; Sat, 23) |
| Richard Stallman | Real men don't attack straw men |
| Julien TOUCHE | setting up ssh tunnel/vpn |
| Jeffrey 'jf' Lim | Re: SSHJail patch for OpenBSD |
| Daniel Ouellet | identifying sparse files and get ride of them trick available? |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Peter MacDonald | demand paging: proposal |
| Stephen Pierce | SLS |
| Drew Eckhardt | Re: 20MB drive & wdxt-gen2 controller on 386? |
