Project

General

Profile

Bug #2414

IOV_MAX = 16?? low?

Added by Richard PALO over 8 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2012-03-16
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Came across this (http://lists.unbit.it/pipermail/uwsgi/2011-May/002082.html) and checked the sources:

$ grep IOV /usr/include/* /usr/include/sys/*
/usr/include/limits.h:#define    _XOPEN_IOV_MAX    16    /* max # iovec/process with readv()/writev() */
/usr/include/limits.h:#define    IOV_MAX        _XOPEN_IOV_MAX
/usr/include/pth.h:#ifndef UIO_MAXIOV
/usr/include/pth.h:#define UIO_MAXIOV 1024
/usr/include/pth.h:#ifndef UIO_MAXIOV
/usr/include/pth.h:#define UIO_MAXIOV 1024
/usr/include/xti.h:#ifndef T_IOV_MAX
/usr/include/xti.h:#define    T_IOV_MAX    16    /* Maximum number of scatter/gather buffers */
/usr/include/xti.h:#endif                /* Should be <= IOV_MAX */
/usr/include/xti.h:#ifndef _SC_T_IOV_MAX
/usr/include/xti.h:#define    _SC_T_IOV_MAX     79    /* Should be same in <unistd.h> for use by */
/usr/include/sys/fault.h:#define    FLTIOVF        7    /* Integer overflow */
/usr/include/sys/fbio.h:#define    FBIOVERTICAL    (FIOC|9)
/usr/include/sys/fbio.h:#define    FBIOVRTOFFSET    (FIOC|38)
/usr/include/sys/socket.h:#define    MSG_MAXIOVLEN    16
/usr/include/sys/stream.h: * Note: DEF_IOV_MAX is defined and used as it is in "fs/vncalls.c" 
/usr/include/sys/stream.h: *     as there isn't a formal definition of IOV_MAX ???
/usr/include/sys/stream.h:#define    DEF_IOV_MAX    16
/usr/include/sys/stream.h:    iovec_t d_iov[DEF_IOV_MAX];    /* iov referenced by uio */
/usr/include/sys/uio.h: * Note: UIOA_IOV_MAX is defined and used as it is in "fs/vncalls.c" 
/usr/include/sys/uio.h: *     as there isn't a formal definition of IOV_MAX for the kernel.
/usr/include/sys/uio.h:#define    UIOA_IOV_MAX    16
/usr/include/sys/uio.h:    uioa_page_t    uioa_locked[UIOA_IOV_MAX]; /* Per iov locked pages */
/usr/include/sys/uio.h:            uioa_page_t xu_a_locked[UIOA_IOV_MAX];
/usr/include/sys/unistd.h:#define    _SC_IOV_MAX            77
/usr/include/sys/unistd.h:#ifndef _SC_T_IOV_MAX
/usr/include/sys/unistd.h:#define    _SC_T_IOV_MAX            79 /* Must be same in <xti.h> */
/usr/include/sys/unistd.h:#endif                       /* T_IOV_MAX must be <= IOV_MAX */

seems low in comparing to NETBSD/Linux:
http://fxr.watson.org/fxr/ident?v=NETBSD20;im=10;i=IOV_MAX

IOV_MAX

track IOV_MAX across all versions

Defined as a preprocessor macro in:

    sys/syslimits.h, line 79

       69  */
       70 #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
       71     defined(_NETBSD_SOURCE)
       72 #define LOGIN_NAME_MAX             17   /* max login name length incl. NUL */
       73 #endif
       74 
       75 /*
       76  * X/Open CAE Specification Issue 5 Version 2
       77  */
       78 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
       79 #define IOV_MAX                  1024   /* max # of iovec's for readv(2) etc. */
       80 #define NZERO                      20   /* default "nice" */
       81 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
       82 
       83 #endif /* !_ANSI_SOURCE */
       84 
       85 #endif /* !_SYS_SYSLIMITS_H_ */
       86 

any current reason this isn't 1024 today?


Files

iov_max.ps (170 KB) iov_max.ps grok search Richard PALO, 2012-03-16 08:10 AM

History

#2

Updated by Rich Lowe over 8 years ago

  • Tags deleted (needs-triage)

Bart's answer is pertinent I think: http://thread.gmane.org/gmane.os.solaris.opensolaris.networking/1318/focus=1326

So the answer would be "It's not as simple as it looks, and nobody's found the time".

Probably worth doing.

#3

Updated by John Levon 7 months ago

  • Status changed from New to Closed

duplicate of #5880

Also available in: Atom PDF