diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-03-09 07:32:20 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-03-09 07:32:20 +0100 |
commit | fc4c5a3828bdba157f8ea406e1f4ceb75c13039c (patch) | |
tree | e3fc4601f914fa59e70c7534206cf5c2c6ba16d1 /include/linux/sched | |
parent | 14a7405b2e814221a951bd7a76ce4a8d24c1b3be (diff) | |
parent | 1b88accf6a659c46d5c8e68912896f112bf882bb (diff) | |
download | linux-stable-fc4c5a3828bdba157f8ea406e1f4ceb75c13039c.tar.gz linux-stable-fc4c5a3828bdba157f8ea406e1f4ceb75c13039c.tar.bz2 linux-stable-fc4c5a3828bdba157f8ea406e1f4ceb75c13039c.zip |
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched')
-rw-r--r-- | include/linux/sched/mm.h | 13 | ||||
-rw-r--r-- | include/linux/sched/user.h | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index 1149533aa2fa..9806184bb3d5 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -36,7 +36,18 @@ static inline void mmgrab(struct mm_struct *mm) atomic_inc(&mm->mm_count); } -extern void mmdrop(struct mm_struct *mm); +extern void __mmdrop(struct mm_struct *mm); + +static inline void mmdrop(struct mm_struct *mm) +{ + /* + * The implicit full barrier implied by atomic_dec_and_test() is + * required by the membarrier system call before returning to + * user-space, after storing to rq->curr. + */ + if (unlikely(atomic_dec_and_test(&mm->mm_count))) + __mmdrop(mm); +} /** * mmget() - Pin the address space associated with a &struct mm_struct. diff --git a/include/linux/sched/user.h b/include/linux/sched/user.h index 0dcf4e480ef7..96fe289c4c6e 100644 --- a/include/linux/sched/user.h +++ b/include/linux/sched/user.h @@ -4,6 +4,7 @@ #include <linux/uidgid.h> #include <linux/atomic.h> +#include <linux/ratelimit.h> struct key; @@ -41,6 +42,9 @@ struct user_struct { defined(CONFIG_NET) atomic_long_t locked_vm; #endif + + /* Miscellaneous per-user rate limit */ + struct ratelimit_state ratelimit; }; extern int uids_sysfs_init(void); |