]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: memcontrol: rearrange charging fast path
authorJohannes Weiner <hannes@cmpxchg.org>
Thu, 26 Jun 2014 00:42:36 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:36 +0000 (10:42 +1000)
commitabbb36e4e4a2db18ea78203e9a720720630eec96
tree607d82242a103ba54ca6e131367fe6ef00d0366b
parent174f57dc28358353df9074a41525aa753c534197
mm: memcontrol: rearrange charging fast path

The charging path currently starts out with OOM condition checks when OOM
is the rarest possible case.

Rearrange this code to run OOM/task dying checks only after trying the
percpu charge and the res_counter charge and bail out before entering
reclaim.  Attempting a charge does not hurt an (oom-)killed task as much
as every charge attempt having to check OOM conditions.  Also, only check
__GFP_NOFAIL when the charge would actually fail.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c