projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crypto: api - Use dedicated workqueue for crypto subsystem
[GitHub/mt8127/android_kernel_alcatel_ttab.git]
/
fs
/
eventpoll.c
diff --git
a/fs/eventpoll.c
b/fs/eventpoll.c
index ba2f9ec71192180647967f02fc1c4221c95c4a5a..011b9b8c90c6976bb15e5bf50ffaf865fd31892b 100644
(file)
--- a/
fs/eventpoll.c
+++ b/
fs/eventpoll.c
@@
-234,8
+234,6
@@
struct ep_pqueue {
/*
* Configuration options available inside /proc/sys/fs/epoll/
*/
/*
* Configuration options available inside /proc/sys/fs/epoll/
*/
-/* Maximum number of epoll devices, per user */
-static int max_user_instances __read_mostly;
/* Maximum number of epoll watched descriptors, per user */
static int max_user_watches __read_mostly;
/* Maximum number of epoll watched descriptors, per user */
static int max_user_watches __read_mostly;
@@
-260,14
+258,6
@@
static struct kmem_cache *pwq_cache __read_mostly;
static int zero;
ctl_table epoll_table[] = {
static int zero;
ctl_table epoll_table[] = {
- {
- .procname = "max_user_instances",
- .data = &max_user_instances,
- .maxlen = sizeof(int),
- .mode = 0644,
- .proc_handler = &proc_dointvec_minmax,
- .extra1 = &zero,
- },
{
.procname = "max_user_watches",
.data = &max_user_watches,
{
.procname = "max_user_watches",
.data = &max_user_watches,
@@
-491,7
+481,6
@@
static void ep_free(struct eventpoll *ep)
mutex_unlock(&epmutex);
mutex_destroy(&ep->mtx);
mutex_unlock(&epmutex);
mutex_destroy(&ep->mtx);
- atomic_dec(&ep->user->epoll_devs);
free_uid(ep->user);
kfree(ep);
}
free_uid(ep->user);
kfree(ep);
}
@@
-581,10
+570,6
@@
static int ep_alloc(struct eventpoll **pep)
struct eventpoll *ep;
user = get_current_user();
struct eventpoll *ep;
user = get_current_user();
- error = -EMFILE;
- if (unlikely(atomic_read(&user->epoll_devs) >=
- max_user_instances))
- goto free_uid;
error = -ENOMEM;
ep = kzalloc(sizeof(*ep), GFP_KERNEL);
if (unlikely(!ep))
error = -ENOMEM;
ep = kzalloc(sizeof(*ep), GFP_KERNEL);
if (unlikely(!ep))
@@
-1141,7
+1126,6
@@
SYSCALL_DEFINE1(epoll_create1, int, flags)
flags & O_CLOEXEC);
if (fd < 0)
ep_free(ep);
flags & O_CLOEXEC);
if (fd < 0)
ep_free(ep);
- atomic_inc(&ep->user->epoll_devs);
error_return:
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
error_return:
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
@@
-1366,8
+1350,10
@@
static int __init eventpoll_init(void)
struct sysinfo si;
si_meminfo(&si);
struct sysinfo si;
si_meminfo(&si);
- max_user_instances = 128;
- max_user_watches = (((si.totalram - si.totalhigh) / 32) << PAGE_SHIFT) /
+ /*
+ * Allows top 4% of lomem to be allocated for epoll watches (per user).
+ */
+ max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) /
EP_ITEM_COST;
/* Initialize the structure used to perform safe poll wait head wake ups */
EP_ITEM_COST;
/* Initialize the structure used to perform safe poll wait head wake ups */