Don't wakeup every 100msec if we are not expecting an event
that wont already wakes up poll() automatically.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-static void fio_server_check_fork_items(struct flist_head *list, int bla)
+static void fio_server_check_fork_items(struct flist_head *list)
{
struct flist_head *entry, *tmp;
struct fio_fork_item *ffi;
{
struct flist_head *entry, *tmp;
struct fio_fork_item *ffi;
static void fio_server_check_jobs(void)
{
static void fio_server_check_jobs(void)
{
- fio_server_check_fork_items(&job_list, 0);
+ fio_server_check_fork_items(&job_list);
}
static void fio_server_check_conns(void)
{
}
static void fio_server_check_conns(void)
{
- fio_server_check_fork_items(&conn_list, 1);
+ fio_server_check_fork_items(&conn_list);
}
static int handle_run_cmd(struct fio_net_cmd *cmd)
}
static int handle_run_cmd(struct fio_net_cmd *cmd)
- ret = poll(&pfd, 1, 100);
+ int timeout = 1000;
+
+ if (!flist_empty(&job_list))
+ timeout = 100;
+
+ ret = poll(&pfd, 1, timeout);
if (ret < 0) {
if (errno == EINTR)
break;
if (ret < 0) {
if (errno == EINTR)
break;
pfd.fd = listen_sk;
pfd.events = POLLIN;
do {
pfd.fd = listen_sk;
pfd.events = POLLIN;
do {
- ret = poll(&pfd, 1, 100);
+ int timeout = 1000;
+
+ if (!flist_empty(&conn_list))
+ timeout = 100;
+
+ ret = poll(&pfd, 1, timeout);
if (ret < 0) {
if (errno == EINTR)
break;
if (ret < 0) {
if (errno == EINTR)
break;