Kernel

共 257 篇文章。

MAXUSERS=0意味着什么?

• Kernel

自从01年dillon commit之后一直就用着MAXUSERS 0。今天alu提到说MAXUSERS不合适的时候有可能会造成系统负荷能力下降,于是看了代码,发现MAXUSERS是根据内存大小算出来的,32-512之间。另外,实践证明MAXUSERS看来不能设置为2048(起不来)……

阅读全文… ( 本文约 216 字,阅读大致需要 1 分钟 )

How to debug a live FreeBSD kernel?

• Kernel

To quote Matthew Dillon:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    You can actually run gdb on a live kernel like this:

    gdb -k /dev/mem /path/to/kernel.debug

    You can then use the 'proc' command to switch to a process (give it a
    pid), and do a stack backtrace.  That part only really works if the
    process is blocked on something (i.e. not running).

    But you can also dig around kernel globals and various data structures
    and that can be quite useful on a live system.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>
参与评论

Matthew Dillon's most recent VM work

• Kernel

From the commit log:

Close an interrupt race between vm_page_lookup() and (typically) a vm_page_sleep_busy() check by using the correct spl protection. An interrupt can occur inbetween the two operations and unbusy/free the page in question, causing the busy check to fail and for the code to fall through and then operate on a page that may have been freed and possibly even reused. Also note that vm_page_grab() had the same issue between the lookup, busy check, and vm_page_busy() call.

阅读全文… ( 本文约 229 字,阅读大致需要 2 分钟 )

FreeBSD LOR page

• Kernel

What’are LORs? To quote Robert Watson:

“These warnings are generated by Witness, a run-time lock diagnostic system found in FreeBSD 5-CURRENT kernels (but removed in releases). You can read more about Witness in the WITNESS(4) man page, which talks about its capabilities. Among other things, Witness performs run-time lock order verification using a combination of hard coded lock orders, and run-time detected lock orders, and generates console warnings when lock orders are violated. The intent of this is to detect the potential for deadlocks due to lock order violations; it’s worth observing that Witness is actually slightly conservative, and so it’s possible to get false positives. In the event that Witness is accurately reporting a lock order problem, it’s basically saying “If you were unlucky, a deadlock would have happened here”. There are a couple of “well known” false positives, which we need to do a better job of documenting to prevent spurious reports. The non-well-known ones typically correspond to bugs in newly added locking, as lock order reversals usually get fixed pretty quickly because Witness is busy generating warnings :-).”

阅读全文… ( 本文约 204 字,阅读大致需要 1 分钟 )

我本周需要做的事情

• Diary Excerpt

·毕业设计翻译
·周一、四游泳
·完整的调度队列实现(本地)、远程调度队列的接口部分
·调度器设计文档
·本地调度的实现细节设计(参考ULE的一些思想)、队列的threadsafe处理
·软件学院的事情
·开始撰写毕业论文

阅读全文… ( 本文约 147 字,阅读大致需要 1 分钟 )