Subject: Re: tsleep
To: Mirian Crzig Lennox <lennox@alcita.com>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: tech-kern
Date: 07/05/1999 10:22:17
> Why does tsleep() take a hardcoded string as its mnemonic wchan value?
> I can't imaging this would be any more informative than a simple
> symbol address (especially since we only display the first 6 chars of
> it anyway), and it seems a bit of a waste of memory to have all those
> extra strings in the kernel image.

Often you're sleeping on the address of dynamically allocated memory
(e.g., a vnode).

Mapping back from the address to the type of the object and then to
the type of wait is difficult.

I wouldn't say "impossible", particularly with the pool allocator in
1.4, but it's still going to be expensive.

As an experiment, try replacing tsleep with a macro which ignores the
wchan argument (so the strings don't end up in the kernel binary) and
rebuild a kernel..  see how much space it actually saves you; I doubt
it's going to be very much.

					- Bill