Re: tasklist_lock location

Steve Dodd (dirk@loth.demon.co.uk)
Thu, 1 Jul 1999 13:17:09 +0100


On Thu, Jul 01, 1999 at 12:23:27AM -0700, c. chris erway wrote:

> well, uhh, if anyone's interested, i narrowed the problem down to just
> SMP machines. it sure seems like this symbol is pretty well exported,
> and <linux/sched.h> is definitely #included in my source, but everyone
> who tries to insmod it on an SMP machine (even me) gets the same
> message:

I've just woken up, so I might be about to talk crap, but:

On UP, rwlock_t (which is what tasklist_lock is) is an empty structure, i.e.
it takes no space. The macros that use it - {read,write}_{,un}lock - don't do
anything on UP[1]. When compiled for SMP, the lock exists and the macros
operate on it. AFAICS, tasklist_lock is not exported from the kernel anywhere
- there needs to be an

EXPORT_SYMBOL(tasklist_lock)

somewhere for it to be visible from modules.

I guess you need to submit a patch that adds that to the appropriate section
of kernel/ksyms.c if you want your module to work with stock kernels. Otherwise,
just add it to your local kernel.

S.

[1] As of 2.3.8ish, the macros reference the empty structure on UP even though
they don't do anything, to avoid 'unused variable' messages. So your module
won't work on UP either for 2.3.8+.

-- 
"Pascal is Pascal is Pascal is dog meat."
                -- M. Devine and P. Larson, Computer Science 340

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/