Project

General

Profile

Bug #2470

closed

[PATCH] network_write_chunkqueue_writev repeatedly calls sysctl to look up iov_max

Added by kevinday over 7 years ago. Updated over 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

On systems with sysconf(_SC_IOV_MAX), network_write_chunkqueue_writev prefers that over other options. On FreeBSD, sysconf is implemented by doing a sysctl lookup of kern.iov_max each time it's called. This has the full weight of a syscall, and is happening once every time through the for() loop.

The patch below checks the max_chunks value only once and remembers it, cutting the number of syscalls network_write_chunkqueue_writev makes in half. Also changes the error message if no way of looking up max_chunks is found to file a bug here instead of annoying Jan by email.


Files

writev.diff.txt (2.43 KB) writev.diff.txt kevinday, 2013-02-05 17:11
#1

Updated by stbuehler over 7 years ago

  • Target version set to 1.4.33
#2

Updated by stbuehler over 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2885.

Also available in: Atom