Kernel

共 215 篇文章。

谁是idiot?

• Kernel

有人在有人问是不是要实现类似FreeBSD的ZERO_COPY_SOCKET的时候怒啦,说啦:“I claim that Mach people (and apparently FreeBSD) are incompetent idiots. Playing games with VM is bad. memory copies are also bad, but quite frankly, memory copies often have less downside than VM games, and bigger caches will only continue to drive that point home.”

可是:
a) ZERO_COPY_SOCKET 并非默认启用的功能。
b) FreeBSD在7年前就实现了这个功能,某些系统至今连这个选项都没有。
c) FreeBSD的zero_copy manpage明示了其性能影响。

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

也许可以给ufs(FFS)加个hack?

• Kernel

UFS的目录项中的文件名字段是定长的(参见sys/ufs/dir.h),这样也许我们可以把symlink的内容(如果够短的话)保存到目录项,而不是inode所指定的fragment上,从而访问symlink可以节省最多两次I/O操作。

参与评论

FreeBSD 6.1-RC1即将发布

• Kernel

我们即将发布6.1-RC1。虽然消息有些突然,但总体来说,现在6.1-RC1的情况还算不错,最后的那些问题希望能在一周内搞定。

参与评论

Rebuilding Charlie

• Kernel

So I finally got to figure out that Charlie’s kernel was built on Dec 20 last year, I will upgrade it to latest FreeBSD/amd64 7.0-CURRENT.

Charlie is the desktop box which has many of my hacks on it :-)

参与评论

malloc(3)换了!

• Kernel

Jason Evans同学返回FreeBSD的第一件事就是把malloc(3)的实现换掉了。这个完全重写的malloc(3)实现带来了以下功能:

  • 防止CPU之间发生冲突的分配场(arenas)概念。
  • 类似slab allocator的分配机制。
  • 释放-分配时的对象cache机制。

仅manpage和malloc.c的patchset就超过150K,值得一读。

参与评论

关于system call

• Kernel

在 FreeBSD 开发手册 中,有一部分内容介绍了关于系统调用。里面有这样一段话:

Linux is a UNIX like system. However, its kernel uses the same system-call convention of passing parameters in registers MS-DOS does. As with the UNIX convention, the function number is placed in EAX. The parameters, however, are not passed on the stack but in EBX, ECX, EDX, ESI, EDI, EBP:

open:
  mov eax, 5
  mov ebx, path
  mov ecx, flags
  mov edx, mode
  int 80h

This convention has a great disadvantage over the UNIX way, at least as far as assembly language programming is concerned: Every time you make a kernel call you must push the registers, then pop them later. This makes your code bulkier and slower. Nevertheless, FreeBSD gives you a choice.

可能有人会问了,为什么说 UNIX way (将参数压栈) 更好呢?

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

freefall is now running 6.0-STABLE

• Kernel

After it has runned 4.x series for a too long time, finally kensmith@ has stepped up to upgrade it.

Needless to say what this means, just upgrade all your boxes to FreeBSD 6.x. FreeBSD 6.0-RELEASE is the best release we have released in the recent years, and the best .0 release ever, as proven by many installations and developers’ code review.

参与评论

Solaris ZFS代码公开了

• Kernel

在 这里。ZFS提出了很多很有意思的概念,值得一看。

比较感兴趣的几个地方:(1)Solaris的byteswap实现;(2)DSL;(3)ZIL。暂时还没有仔细看ZIL,但这里有一个很有意思的设计:

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

历史上最成功的RELEASE

• Kernel

昨天Scott Long老大发了一封信说,从过去一个月内的反馈来看,6.0-RELEASE是FreeBSD近几年最为成功的发行版本,同时,也是FreeBSD历史上最为成功的.0发行版本。

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