cvs commit: src/sys/kern kern_sig.c
iedowse at maths.tcd.ie
Fri Mar 4 00:25:37 GMT 2005
In message <42279C72.2000208 at freebsd.org>, David Xu writes:
>how about adding a PNOSWAP to msleep ? but I won't trust the kernel
>under swapping, because they can not give me 100% guarantee, my
>machine crashes several times per-month, even when fscking at boot time,
>mostly it is a page fault.
I haven't been following the discussion very carefully, but it does
seem that when we are doing something that is unexpected to a C
programmer it is very helpful if there is an clear reminder in the
source code at the point where it matters. That would suggest having
a flag passed to msleep that enables swapping of the thread while
it sleeps rather than one to disable the swapping. It may be that
there are relatively few msleep calls that are expected to sleep
for long enough to make swapping the thread beneficial.
BTW, one very useful technique that is incompatible with stack
swapping is the insertion of a marker into a linked list to avoid
having to restart a scan if the list changes. See vm_pageout_scan()
in vm_pageout.c for an example. There are probably quite a few
pieces of code that could use this to avoid a "goto restart;" case.
Of course the marker could be malloc'd if necessary so it is not
a particularly strong argument.
More information about the cvs-src