Kernel

共216篇文章。

谁是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.

可是:

  1. ZERO_COPY_SOCKET并非默认启用的功能。
  2. FreeBSD在7年前就实现了这个功能,某些系统至今连这个选项都没有。
  3. FreeBSD的zero_copy(9) manpage明示了其性能影响。

您也老大不小的人了,怎么老改不了这小孩的毛病呢?

参与评论:谁是idiot?

malloc(3)换了!

Kernel

📜 历史文件已不具备现实意义

这次提交引入的正是后来大名鼎鼎的jemalloc,它取代了FreeBSD原有的phkmalloc,自FreeBSD 7.0起成为系统默认的malloc(3)实现(参见jemalloc(3)及Jason Evans在BSDCan 2006发表的设计论文),后来也被Firefox、Redis、Android等众多项目采用。

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

阅读全文…:malloc(3)换了!(本文约340字,阅读大致需要1分钟)

关于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 (将参数压栈) 更好呢?

阅读全文…:关于system call(本文约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.

参与评论:freefall is now running 6.0-STABLE
搜索文章…(按ESC退出)