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

Configure Feed

Select the types of activity you want to include in your feed.

fs/epoll: remove max_nests argument from ep_call_nested()

Patch series "epoll: some miscellaneous optimizations".

The following are some incremental optimizations on some of the epoll
core. Each patch has the details, but together, the series is seen to
shave off measurable cycles on a number of systems and workloads.

For example, on a 40-core IB, a pipetest as well as parallel
epoll_wait() benchmark show around a 20-30% increase in raw operations
per second when the box is fully occupied (incremental thread counts),
and up to 15% performance improvement with lower counts.

Passes ltp epoll related testcases.

This patch(of 6):

All callers pass the EP_MAX_NESTS constant already, so lets simplify
this a tad and get rid of the redundant parameter for nested eventpolls.

Link: http://lkml.kernel.org/r/20181108051006.18751-2-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jason Baron <jbaron@akamai.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Davidlohr Bueso and committed by
Linus Torvalds
74bdc129 77b8c0a8

+6 -8
+6 -8
fs/eventpoll.c
··· 471 471 * no re-entered. 472 472 * 473 473 * @ncalls: Pointer to the nested_calls structure to be used for this call. 474 - * @max_nests: Maximum number of allowed nesting calls. 475 474 * @nproc: Nested call core function pointer. 476 475 * @priv: Opaque data to be passed to the @nproc callback. 477 476 * @cookie: Cookie to be used to identify this nested call. ··· 479 480 * Returns: Returns the code returned by the @nproc callback, or -1 if 480 481 * the maximum recursion limit has been exceeded. 481 482 */ 482 - static int ep_call_nested(struct nested_calls *ncalls, int max_nests, 483 + static int ep_call_nested(struct nested_calls *ncalls, 483 484 int (*nproc)(void *, void *, int), void *priv, 484 485 void *cookie, void *ctx) 485 486 { ··· 498 499 */ 499 500 list_for_each_entry(tncur, lsthead, llink) { 500 501 if (tncur->ctx == ctx && 501 - (tncur->cookie == cookie || ++call_nests > max_nests)) { 502 + (tncur->cookie == cookie || ++call_nests > EP_MAX_NESTS)) { 502 503 /* 503 504 * Ops ... loop detected or maximum nest level reached. 504 505 * We abort this wake by breaking the cycle itself. ··· 572 573 { 573 574 int this_cpu = get_cpu(); 574 575 575 - ep_call_nested(&poll_safewake_ncalls, EP_MAX_NESTS, 576 + ep_call_nested(&poll_safewake_ncalls, 576 577 ep_poll_wakeup_proc, NULL, wq, (void *) (long) this_cpu); 577 578 578 579 put_cpu(); ··· 1332 1333 } 1333 1334 } else { 1334 1335 error = ep_call_nested(&poll_loop_ncalls, 1335 - EP_MAX_NESTS, 1336 1336 reverse_path_check_proc, 1337 1337 child_file, child_file, 1338 1338 current); ··· 1365 1367 /* let's call this for all tfiles */ 1366 1368 list_for_each_entry(current_file, &tfile_check_list, f_tfile_llink) { 1367 1369 path_count_init(); 1368 - error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, 1370 + error = ep_call_nested(&poll_loop_ncalls, 1369 1371 reverse_path_check_proc, current_file, 1370 1372 current_file, current); 1371 1373 if (error) ··· 1874 1876 ep_tovisit = epi->ffd.file->private_data; 1875 1877 if (ep_tovisit->visited) 1876 1878 continue; 1877 - error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, 1879 + error = ep_call_nested(&poll_loop_ncalls, 1878 1880 ep_loop_check_proc, epi->ffd.file, 1879 1881 ep_tovisit, current); 1880 1882 if (error != 0) ··· 1914 1916 int ret; 1915 1917 struct eventpoll *ep_cur, *ep_next; 1916 1918 1917 - ret = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, 1919 + ret = ep_call_nested(&poll_loop_ncalls, 1918 1920 ep_loop_check_proc, file, ep, current); 1919 1921 /* clear visited list */ 1920 1922 list_for_each_entry_safe(ep_cur, ep_next, &visited_list,