Skip to content

Commit 2239cc6

Browse files
committed
Merge branch 'epoll-busypoll'
Alexander Duyck says: ==================== Add busy poll support for epoll This patch set adds support for using busy polling with epoll. The main idea behind this is that we record the NAPI ID for the last event that is moved onto the ready list for the epoll context and then when we no longer have any events on the ready list we begin polling with that ID. If the busy polling does not yield any events then we will reset the NAPI ID to 0 and wait until a new event is added to the ready list with a valid NAPI ID before we will resume busy polling. Most of the changes in this set authored by me are meant to be cleanup or fixes for various things. For example, I am trying to make it so that we don't perform hash look-ups for the NAPI instance when we are only working with sender_cpu and the like. At the heart of this set is the last 3 patches which enable epoll support and add support for obtaining the NAPI ID of a given socket. With these it becomes possible for an application to make use of epoll and get optimal busy poll utilization by stacking multiple sockets with the same NAPI ID on the same epoll context. v1: The first version of this series only allowed epoll to busy poll if all of the sockets with a NAPI ID shared the same NAPI ID. I feel we were too strict with this requirement, so I changed the behavior for v2. v2: The second version was pretty much a full rewrite of the first set. The main changes consisted of pulling apart several patches to better address the need to clean up a few items and to make the code easier to review. In the set however I went a bit overboard and was trying to fix an issue that would only occur with 500+ years of uptime, and in the process limited the range for busy_poll/busy_read unnecessarily. v3: Split off the code for limiting busy_poll and busy_read into a separate patch for net. Updated patch that changed busy loop time tracking so that it uses "local_clock() >> 10" as we originally did. Tweaked "Change return type.." patch by moving declaration of "work" inside the loop where is was accessed and always reset to 0. Added "Acked-by" for patches that received acks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents dcb421f + 6d43390 commit 2239cc6

File tree

23 files changed

+244
-81
lines changed

23 files changed

+244
-81
lines changed

arch/alpha/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,6 @@
101101

102102
#define SO_MEMINFO 55
103103

104+
#define SO_INCOMING_NAPI_ID 56
105+
104106
#endif /* _UAPI_ASM_SOCKET_H */

arch/avr32/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,6 @@
9494

9595
#define SO_MEMINFO 55
9696

97+
#define SO_INCOMING_NAPI_ID 56
98+
9799
#endif /* _UAPI__ASM_AVR32_SOCKET_H */

arch/frv/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,7 @@
9494

9595
#define SO_MEMINFO 55
9696

97+
#define SO_INCOMING_NAPI_ID 56
98+
9799
#endif /* _ASM_SOCKET_H */
98100

arch/ia64/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,6 @@
103103

104104
#define SO_MEMINFO 55
105105

106+
#define SO_INCOMING_NAPI_ID 56
107+
106108
#endif /* _ASM_IA64_SOCKET_H */

arch/m32r/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,6 @@
9494

9595
#define SO_MEMINFO 55
9696

97+
#define SO_INCOMING_NAPI_ID 56
98+
9799
#endif /* _ASM_M32R_SOCKET_H */

arch/mips/include/uapi/asm/socket.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,6 @@
112112

113113
#define SO_MEMINFO 55
114114

115+
#define SO_INCOMING_NAPI_ID 56
115116

116117
#endif /* _UAPI_ASM_SOCKET_H */

arch/mn10300/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,6 @@
9494

9595
#define SO_MEMINFO 55
9696

97+
#define SO_INCOMING_NAPI_ID 56
98+
9799
#endif /* _ASM_SOCKET_H */

arch/parisc/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,6 @@
9393

9494
#define SO_MEMINFO 0x4030
9595

96+
#define SO_INCOMING_NAPI_ID 0x4031
97+
9698
#endif /* _UAPI_ASM_SOCKET_H */

arch/powerpc/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,6 @@
101101

102102
#define SO_MEMINFO 55
103103

104+
#define SO_INCOMING_NAPI_ID 56
105+
104106
#endif /* _ASM_POWERPC_SOCKET_H */

arch/s390/include/uapi/asm/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,6 @@
100100

101101
#define SO_MEMINFO 55
102102

103+
#define SO_INCOMING_NAPI_ID 56
104+
103105
#endif /* _ASM_SOCKET_H */

0 commit comments

Comments
 (0)