Linux – Difference between poll_s and ep_poll WCHAN in ps output

linuxprocessps

When I issue ps -elf|grep python for example on my system, I see these:

1 S 1000      6020  6008  0  80   0 -  9914 poll_s Jul12 ?        00:00:01     python manage.py run_gunicorn -t 3600 -w 8 -b 127.0.0.1:8000
0 S 1000     22496 22491  0  80   0 - 10477 ep_pol 12:32 ?        00:00:10     /var/lib/mywebapp/env/bin/python /var/lib/mywebapp/env/bin/pserve development.ini

What is the difference between poll_s and ep_pol?

Best Answer

To display a bit more of the WCHAN function name, you can use e.g.:

ps -e -o pid,wchan=WIDE-WCHAN-COLUMN -o comm

This will show you the two functions are ep_poll and poll_schedule_timeout.

The first is in fs/eventpoll.c in the kernel, and is related to epoll facility, specifically to the epoll_wait system call.
The other is in fs/select.c and will be used both for the "plain" poll system call, and for select.

So they are both "waiting for something I/O-related to happen" wait states, but for different system facilities.