diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-27 14:11:07 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-27 14:11:07 +0100 |
commit | 85c24cd8d3676cbae9e8809e894e68025c6d497e (patch) | |
tree | 024c4b655c1a8e6943ed8e75b64be38980508cfe /mm/oom_kill.c | |
parent | 49d776ffb50f2e428aafb6a6576e58e80f1e886c (diff) | |
parent | d1d0b6b668818571122d30d68a0b3f768bd83a52 (diff) |
Merge branch 'for-linus' into for-next
Merged upstream branch to make further fireworks development easier
(and avoid conflicts earlier).
Conflicts:
sound/firewire/bebob/bebob_focusrite.c
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r-- | mm/oom_kill.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index bbf405a3a18f..5340f6b91312 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -404,6 +404,23 @@ static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, dump_tasks(memcg, nodemask); } +/* + * Number of OOM killer invocations (including memcg OOM killer). + * Primarily used by PM freezer to check for potential races with + * OOM killed frozen task. + */ +static atomic_t oom_kills = ATOMIC_INIT(0); + +int oom_kills_count(void) +{ + return atomic_read(&oom_kills); +} + +void note_oom_kill(void) +{ + atomic_inc(&oom_kills); +} + #define K(x) ((x) << (PAGE_SHIFT-10)) /* * Must be called while holding a reference to p, which will be released upon |