Skip to contentSkip to conversation

cr_tests: epoll: Add sk10k - poll io on ten thousand sockets with epoll

PATCH In review Matt Helsley 1 participant 1 message Oct 12, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 5/7 cr_tests: epoll: Add sk10k - poll io on ten thousand sockets with epoll

This test opens a specified number of socket pairs, sends a message over each, reads the message, and exits. It uses epoll to "wait" for events on the sockets. This tests epoll sets that may stress the watch limit, the open file descriptor limit, and the limits of epoll c/r itself.

Since an epoll item c/r struct takes 20 bytes on i386 we need at least 205 sockets to have multiple 4k pages worth of epoll items to checkpoint.

The goal is to foil the kmalloc used to checkpoint epoll items in the kernel such that we can't checkpoint them all in one go and without needing to reproduce OOM conditions. Since we can't rely on PAGE_SIZE to calculate the number of sockets needed to do this and since we're limited by rlimit anyhow, we just go with the hard limit for now.

---
 epoll/Makefile |    2 +-
 epoll/run.sh   |    2 +-
 epoll/sk10k.c  |  311 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 313 insertions(+), 2 deletions(-)
 create mode 100644 epoll/sk10k.c
epoll/Makefile +1 -1
index f701352..c94f5f5 100644
@@ -3,7 +3,7 @@
 LIBS := ../libcrtest/libcrtest.a ./libeptest.a
 CFLAGS := -Wall $(ARCHOPTS) -I../ -I../libcrtest
 
-PROGS=empty pipe
+PROGS=empty pipe sk10k
 
 .PHONY: all clean
 
epoll/run.sh +1 -1
index 405692a..6f64ee8 100755
@@ -20,7 +20,7 @@ fi ) | grep -E '^[[:space:]]*CONFIG_EPOLL=y' > /dev/null 2>&1
 	exit 1
 }
 
-TESTS=( empty pipe )
+TESTS=( empty pipe sk10k )
 #make ${TESTS[@]}
 
 # mount -t cgroup foo /cg
epoll/sk10k.c new file +311 -0

311 lines not on this page · raw message

Signature · 1 line
1.5.6.3