kstackusage() patch request for comments

Alexander Motin mav at FreeBSD.org
Sun Jan 27 10:27:09 PST 2008


Hi.

I have made a patch
http://www.mavhome.dp.ua/kstackusage.patch
that implements machine dependent function returning current kernel 
thread stack usage statistics and uses it in netgraph subsystem for 
receiving maximum benefit from direct function calls and minimum 
queueing while keeping stack protected. As I have never developed 
machine-dependant things I would like to hear any comments about it.

The main question I have is about source files and headers I should use 
for this specific purposes. Is it correct way to define function in 
machine independent header, but implement it in machdep.c? Or I should 
define it in machine dependent headers?

Also I would be grateful for help with implementations of this function 
for arch different from i386/amd64.

Thanks.

-- 
Alexander Motin


More information about the freebsd-hackers mailing list