diff options
| author | Alex Shi <alex.shi@linaro.org> | 2016-06-14 17:08:03 +0800 |
|---|---|---|
| committer | Alex Shi <alex.shi@linaro.org> | 2016-06-14 17:08:03 +0800 |
| commit | 9ad8208bd7d0a5d9e232142d95f94bddc35ffff7 (patch) | |
| tree | 7cdc0808be3bf18db4c44aafc56d565770d297cb /kernel | |
| parent | cf5ba83bb248452b5b320d8f2ee48bd90e5cf3f6 (diff) | |
| parent | c66b2190a13e321233ac1349d238d699dffefe09 (diff) | |
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/exit.c | 29 | ||||
| -rw-r--r-- | kernel/sysctl.c | 14 |
2 files changed, 34 insertions, 9 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 07110c6020a0..ffba5df4abd5 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -918,17 +918,28 @@ static int eligible_pid(struct wait_opts *wo, struct task_struct *p) task_pid_type(p, wo->wo_type) == wo->wo_pid; } -static int eligible_child(struct wait_opts *wo, struct task_struct *p) +static int +eligible_child(struct wait_opts *wo, bool ptrace, struct task_struct *p) { if (!eligible_pid(wo, p)) return 0; - /* Wait for all children (clone and not) if __WALL is set; - * otherwise, wait for clone children *only* if __WCLONE is - * set; otherwise, wait for non-clone children *only*. (Note: - * A "clone" child here is one that reports to its parent - * using a signal other than SIGCHLD.) */ - if (((p->exit_signal != SIGCHLD) ^ !!(wo->wo_flags & __WCLONE)) - && !(wo->wo_flags & __WALL)) + + /* + * Wait for all children (clone and not) if __WALL is set or + * if it is traced by us. + */ + if (ptrace || (wo->wo_flags & __WALL)) + return 1; + + /* + * Otherwise, wait for clone children *only* if __WCLONE is set; + * otherwise, wait for non-clone children *only*. + * + * Note: a "clone" child here is one that reports to its parent + * using a signal other than SIGCHLD, or a non-leader thread which + * we can only see if it is traced by us. + */ + if ((p->exit_signal != SIGCHLD) ^ !!(wo->wo_flags & __WCLONE)) return 0; return 1; @@ -1301,7 +1312,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, if (unlikely(exit_state == EXIT_DEAD)) return 0; - ret = eligible_child(wo, p); + ret = eligible_child(wo, ptrace, p); if (!ret) return ret; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 35bfe0c1360b..11783ed47dd3 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1766,6 +1766,20 @@ static struct ctl_table fs_table[] = { .proc_handler = &pipe_proc_fn, .extra1 = &pipe_min_size, }, + { + .procname = "pipe-user-pages-hard", + .data = &pipe_user_pages_hard, + .maxlen = sizeof(pipe_user_pages_hard), + .mode = 0644, + .proc_handler = proc_doulongvec_minmax, + }, + { + .procname = "pipe-user-pages-soft", + .data = &pipe_user_pages_soft, + .maxlen = sizeof(pipe_user_pages_soft), + .mode = 0644, + .proc_handler = proc_doulongvec_minmax, + }, { } }; |
