> OK, this seems interesting. What if no task has the swap token, would that > mean > that either virtual memory is not being used at the time or that all the tasks > have the pages they need already swapped in? Either way, the swap token thing > is something I can look into. I suspect it means that there is not enough VM pressure to cause any type of paging. > I'm not sure what you mean by this. Is "vmstat 1" a function I can call from > sched.c? I assume so/si is swap in/swap out. I'm trying to find something > about that in Linux Kernel Development but I can't see so/si blocks or anything > like "vmstat 1" in the index. There's a bit about what userspace is at the > beginning but perhaps these things would be under different headings. vmstat is a userspace command. > > I'm still not sure how to find why I it crashes when I call sys_sysinfo from the you can't call system calls from the kernel reliably, and esp not from the scheduler (the system call exit path will invoke the scheduler and you can get recursion). > scheduler. It seems to be reconising both the struct I give as an arguement and > the function itself otherwise it wouldn't compile. It works fine when I comment > that line out. Perhaps I'm supposed to do something else to set it up or > maybeit can only be used from elsewhere. on second thought the best measure you could work from I suspect is the rate of hard page faults..... the kernel keeps that information somewhere (I just forget where) but it's a pretty reasonable indication of memory pressure. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/