diff options
author | Davide Libenzi <davidel@xmailserver.org> | 2009-01-29 14:25:26 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-02 08:28:13 -0800 |
commit | a0aec447b8076f10f0f46433f20ad3fa32e2c500 (patch) | |
tree | 6302c76c0fac625be34f8911f218820110ffb7f6 /include/linux/sched.h | |
parent | f2c89cc2a9827679bfa950a14875661e26d9e492 (diff) | |
download | lwn-a0aec447b8076f10f0f46433f20ad3fa32e2c500.tar.gz lwn-a0aec447b8076f10f0f46433f20ad3fa32e2c500.zip |
epoll: drop max_user_instances and rely only on max_user_watches
commit 9df04e1f25effde823a600e755b51475d438f56b upstream.
Linus suggested to put limits where the money is, and max_user_watches
already does that w/out the need of max_user_instances. That has the
advantage to mitigate the potential DoS while allowing pretty generous
default behavior.
Allowing top 4% of low memory (per user) to be allocated in epoll watches,
we have:
LOMEM MAX_WATCHES (per user)
512MB ~178000
1GB ~356000
2GB ~712000
A box with 512MB of lomem, will meet some challenge in hitting 180K
watches, socket buffers math teaches us. No more max_user_instances
limits then.
Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Cc: Bron Gondwana <brong@fastmail.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 086f5e1aee60..03e09027f730 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -588,7 +588,6 @@ struct user_struct { atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ #endif #ifdef CONFIG_EPOLL - atomic_t epoll_devs; /* The number of epoll descriptors currently open */ atomic_t epoll_watches; /* The number of file descriptors currently watched */ #endif #ifdef CONFIG_POSIX_MQUEUE |