*Nix and Win32 Kernel

malloc(3)换了!

| *nix and Win32 Kernel

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

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

参与评论

关于system call

| *nix and Win32 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

| *nix and Win32 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代码公开了

| *nix and Win32 Kernel

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

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

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

历史上最成功的RELEASE

| *nix and Win32 Kernel

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

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

*BSD queue.h

| *nix and Win32 Kernel

Derived from the ancient BSD Unix, *BSD has a set of queue related macros which are described in queue(3), and implemented in src/sys/sys/queue.h. These are primarily used in the kernel, but also useful for userland applications.

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

inetd(8) kqueue patchset

| *nix and Win32 Kernel

The patchset would teach inetd(8) about kqueue, which is originally authored by John-Mark and I have integerated it into the “delphijfork”. Now it was updated to fit 7.0-CURRENT.

参与评论

FreeBSD 6.0-RELEASE named

| *nix and Win32 Kernel

Now this server is running:

[delphij@tarsier] ~> uname -a
FreeBSD tarsier.delphij.net 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Wed Nov 2 14:39:40 CST 2005 delphij@tarsier.delphij.net:/usr/obj/usr/src/sys/TARSIER i386

参与评论

我靠!!不带这么玩的……改一个sysctl能让mysql性能提高6倍?!

| *nix and Win32 Kernel

最近 current 邮件列表讨论的很凶的一个问题是,MySQL很不理性地在每一个I/O操作时都调一次time()。这一操作在FreeBSD上面相当的昂贵(为了保证精度),而Linux采取了许多优化(有些是牺牲精度的)措施,因而性能差距越来越大。

于是有一个人在FreeBSD上做了试验,说改一下默认的时钟能够将性能提高6倍……不带这么玩的,ft……

BTW. clive也测了一下,在他机器上结果是:

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

Linux threading bug

| *nix and Win32 Kernel

A collegue of mine has reported a FreeBSD “bug” that, when the main thread exits, the whole process is terminated. He complained that pthread_detach() would not cause the thread to run without the main thread, while Linux did.

With some experiments we have figured out that this is actually a Linux bug, which violates POSIX. Interestingly, Solaris has the same behavior that FreeBSD have.

The POSIX pthread_create() said:

Note that the thread in which main() was originally invokeddiffers from this. When it returns from main(), the effectshall be as if there was an implicit call to exit() usingthe return value of main() as the exit status."

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