Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: rename busy poll socket op and globals

Rename LL_SO to BUSY_POLL_SO
Rename sysctl_net_ll_{read,poll} to sysctl_busy_{read,poll}
Fix up users of these variables.
Fix documentation for sysctl.

a patch for the socket.7 man page will follow separately,
because of limitations of my mail setup.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eliezer Tamir and committed by
David S. Miller
64b0dc51 8b80cda5

+37 -36
+9 -8
Documentation/sysctl/net.txt
··· 50 50 it's a Per-CPU variable. 51 51 Default: 64 52 52 53 - low_latency_read 53 + busy_read 54 54 ---------------- 55 55 Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL) 56 56 Approximate time in us to busy loop waiting for packets on the device queue. 57 - This sets the default value of the SO_LL socket option. 58 - Can be set or overridden per socket by setting socket option SO_LL, which is 59 - the preferred method of enabling. 60 - If you need to enable the feature globally via sysctl, a value of 50 is recommended. 57 + This sets the default value of the SO_BUSY_POLL socket option. 58 + Can be set or overridden per socket by setting socket option SO_BUSY_POLL, 59 + which is the preferred method of enabling. If you need to enable the feature 60 + globally via sysctl, a value of 50 is recommended. 61 61 Will increase power usage. 62 62 Default: 0 (off) 63 63 64 - low_latency_poll 64 + busy_poll 65 65 ---------------- 66 66 Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL) 67 67 Approximate time in us to busy loop waiting for events. 68 68 Recommended value depends on the number of sockets you poll on. 69 69 For several sockets 50, for several hundreds 100. 70 70 For more than that you probably want to use epoll. 71 - Note that only sockets with SO_LL set will be busy polled, so you want to either 72 - selectively set SO_LL on those sockets or set sysctl.net.low_latency_read globally. 71 + Note that only sockets with SO_BUSY_POLL set will be busy polled, 72 + so you want to either selectively set SO_BUSY_POLL on those sockets or set 73 + sysctl.net.busy_read globally. 73 74 Will increase power usage. 74 75 Default: 0 (off) 75 76
+1 -1
arch/alpha/include/uapi/asm/socket.h
··· 81 81 82 82 #define SO_SELECT_ERR_QUEUE 45 83 83 84 - #define SO_LL 46 84 + #define SO_BUSY_POLL 46 85 85 86 86 #endif /* _UAPI_ASM_SOCKET_H */
+1 -1
arch/avr32/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* __ASM_AVR32_SOCKET_H */
+1 -1
arch/cris/include/uapi/asm/socket.h
··· 76 76 77 77 #define SO_SELECT_ERR_QUEUE 45 78 78 79 - #define SO_LL 46 79 + #define SO_BUSY_POLL 46 80 80 81 81 #endif /* _ASM_SOCKET_H */ 82 82
+1 -1
arch/frv/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_SOCKET_H */ 80 80
+1 -1
arch/h8300/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_SOCKET_H */
+1 -1
arch/ia64/include/uapi/asm/socket.h
··· 83 83 84 84 #define SO_SELECT_ERR_QUEUE 45 85 85 86 - #define SO_LL 46 86 + #define SO_BUSY_POLL 46 87 87 88 88 #endif /* _ASM_IA64_SOCKET_H */
+1 -1
arch/m32r/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_M32R_SOCKET_H */
+1 -1
arch/mips/include/uapi/asm/socket.h
··· 92 92 93 93 #define SO_SELECT_ERR_QUEUE 45 94 94 95 - #define SO_LL 46 95 + #define SO_BUSY_POLL 46 96 96 97 97 #endif /* _UAPI_ASM_SOCKET_H */
+1 -1
arch/mn10300/include/uapi/asm/socket.h
··· 74 74 75 75 #define SO_SELECT_ERR_QUEUE 45 76 76 77 - #define SO_LL 46 77 + #define SO_BUSY_POLL 46 78 78 79 79 #endif /* _ASM_SOCKET_H */
+1 -1
arch/parisc/include/uapi/asm/socket.h
··· 73 73 74 74 #define SO_SELECT_ERR_QUEUE 0x4026 75 75 76 - #define SO_LL 0x4027 76 + #define SO_BUSY_POLL 0x4027 77 77 78 78 /* O_NONBLOCK clashes with the bits used for socket types. Therefore we 79 79 * have to define SOCK_NONBLOCK to a different value here.
+1 -1
arch/powerpc/include/uapi/asm/socket.h
··· 81 81 82 82 #define SO_SELECT_ERR_QUEUE 45 83 83 84 - #define SO_LL 46 84 + #define SO_BUSY_POLL 46 85 85 86 86 #endif /* _ASM_POWERPC_SOCKET_H */
+1 -1
arch/s390/include/uapi/asm/socket.h
··· 80 80 81 81 #define SO_SELECT_ERR_QUEUE 45 82 82 83 - #define SO_LL 46 83 + #define SO_BUSY_POLL 46 84 84 85 85 #endif /* _ASM_SOCKET_H */
+1 -1
arch/sparc/include/uapi/asm/socket.h
··· 70 70 71 71 #define SO_SELECT_ERR_QUEUE 0x0029 72 72 73 - #define SO_LL 0x0030 73 + #define SO_BUSY_POLL 0x0030 74 74 75 75 /* Security levels - as per NRL IPv6 - don't actually do anything */ 76 76 #define SO_SECURITY_AUTHENTICATION 0x5001
+1 -1
arch/xtensa/include/uapi/asm/socket.h
··· 85 85 86 86 #define SO_SELECT_ERR_QUEUE 45 87 87 88 - #define SO_LL 46 88 + #define SO_BUSY_POLL 46 89 89 90 90 #endif /* _XTENSA_SOCKET_H */
+4 -4
include/net/busy_poll.h
··· 30 30 #ifdef CONFIG_NET_LL_RX_POLL 31 31 32 32 struct napi_struct; 33 - extern unsigned int sysctl_net_ll_read __read_mostly; 34 - extern unsigned int sysctl_net_ll_poll __read_mostly; 33 + extern unsigned int sysctl_net_busy_read __read_mostly; 34 + extern unsigned int sysctl_net_busy_poll __read_mostly; 35 35 36 36 /* return values from ndo_ll_poll */ 37 37 #define LL_FLUSH_FAILED -1 ··· 39 39 40 40 static inline bool net_busy_loop_on(void) 41 41 { 42 - return sysctl_net_ll_poll; 42 + return sysctl_net_busy_poll; 43 43 } 44 44 45 45 /* a wrapper to make debug_smp_processor_id() happy ··· 72 72 /* in poll/select we use the global sysctl_net_ll_poll value */ 73 73 static inline unsigned long busy_loop_end_time(void) 74 74 { 75 - return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_ll_poll); 75 + return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_busy_poll); 76 76 } 77 77 78 78 static inline bool sk_can_busy_loop(struct sock *sk)
+1 -1
include/uapi/asm-generic/socket.h
··· 76 76 77 77 #define SO_SELECT_ERR_QUEUE 45 78 78 79 - #define SO_LL 46 79 + #define SO_BUSY_POLL 46 80 80 81 81 #endif /* __ASM_GENERIC_SOCKET_H */
+3 -3
net/core/sock.c
··· 901 901 break; 902 902 903 903 #ifdef CONFIG_NET_LL_RX_POLL 904 - case SO_LL: 904 + case SO_BUSY_POLL: 905 905 /* allow unprivileged users to decrease the value */ 906 906 if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN)) 907 907 ret = -EPERM; ··· 1171 1171 break; 1172 1172 1173 1173 #ifdef CONFIG_NET_LL_RX_POLL 1174 - case SO_LL: 1174 + case SO_BUSY_POLL: 1175 1175 v.val = sk->sk_ll_usec; 1176 1176 break; 1177 1177 #endif ··· 2294 2294 2295 2295 #ifdef CONFIG_NET_LL_RX_POLL 2296 2296 sk->sk_napi_id = 0; 2297 - sk->sk_ll_usec = sysctl_net_ll_read; 2297 + sk->sk_ll_usec = sysctl_net_busy_read; 2298 2298 #endif 2299 2299 2300 2300 /*
+4 -4
net/core/sysctl_net_core.c
··· 300 300 #endif /* CONFIG_NET_FLOW_LIMIT */ 301 301 #ifdef CONFIG_NET_LL_RX_POLL 302 302 { 303 - .procname = "low_latency_poll", 304 - .data = &sysctl_net_ll_poll, 303 + .procname = "busy_poll", 304 + .data = &sysctl_net_busy_poll, 305 305 .maxlen = sizeof(unsigned int), 306 306 .mode = 0644, 307 307 .proc_handler = proc_dointvec 308 308 }, 309 309 { 310 - .procname = "low_latency_read", 311 - .data = &sysctl_net_ll_read, 310 + .procname = "busy_read", 311 + .data = &sysctl_net_busy_read, 312 312 .maxlen = sizeof(unsigned int), 313 313 .mode = 0644, 314 314 .proc_handler = proc_dointvec
+2 -2
net/socket.c
··· 107 107 #include <net/busy_poll.h> 108 108 109 109 #ifdef CONFIG_NET_LL_RX_POLL 110 - unsigned int sysctl_net_ll_read __read_mostly; 111 - unsigned int sysctl_net_ll_poll __read_mostly; 110 + unsigned int sysctl_net_busy_read __read_mostly; 111 + unsigned int sysctl_net_busy_poll __read_mostly; 112 112 #endif 113 113 114 114 static int sock_no_open(struct inode *irrelevant, struct file *dontcare);