tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Patch: create/destroy optimization for pipes



The dedicated pipe code is quite a bit faster than the socket code. Here's a
comparison from libmicro, with PIPE_SOCKETPAIR on the right. This does not
test page loaning.

        http://www.netbsd.org/~ad/cleanout/pipe.html

Creating and destroying pipes is very expensive because VA space and memory
must be allocated and freed from kernel_map. This causes global TLB
shootdowns, meaning interrupts on MP systems.

The below patch:

- Caches VA space and memory for the reader side of pipes, which take care
  of buffering when the pipe is normal (ie uni-directional). This eliminates
  the TLB shootdowns.

- It converts the pipe code to use mutex_obj_alloc(), replacing its custom
  pool_cache.

- It makes better use of pool_cache, eliminating a lot of calls to
  initialize and destroy pipe objects.

Notes:

- It may not apply cleanly to -current.

- The sender-size buffer record needs to be zeroed out after a pipe is
  allocated. The patch omits this.

        http://www.netbsd.org/~ad/cleanout/pipe.diff

Comments?

Thanks,
Andrew


Home | Main Index | Thread Index | Old Index