summaryrefslogtreecommitdiffstats
path: root/include/linux/fec.h
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2011-07-25 17:12:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 20:57:11 -0700
commite83c32e8f92724a06a22a3b42f3afc07db93e131 (patch)
treeeeefe97f26e7b4faf672eba777a12749bfdad024 /include/linux/fec.h
parent9276aad6c898dbcc31d095f2934dedd5cbb2e93e (diff)
downloadop-kernel-dev-e83c32e8f92724a06a22a3b42f3afc07db93e131.zip
op-kernel-dev-e83c32e8f92724a06a22a3b42f3afc07db93e131.tar.gz
tmpfs: simplify prealloc_page
The prealloc_page handling in shmem_getpage_gfp() is unnecessarily complicated: first simplify that before going on to filepage/swappage. That's right, don't report ENOMEM when the preallocation fails: we may or may not need the page. But simply report ENOMEM once we find we do need it, instead of dropping lock, repeating allocation, unwinding on failure etc. And leave the out label on the fast path, don't goto. Fix something that looks like a bug but turns out not to be: set PageSwapBacked on prealloc_page before its mem_cgroup_cache_charge(), as the removed case was doing. That's important before adding to LRU (determines which LRU the page goes on), and does affect which path it takes through memcontrol.c, but in the end MEM_CGROUP_CHANGE_TYPE_ SHMEM is handled no differently from CACHE. Signed-off-by: Hugh Dickins <hughd@google.com> Acked-by: Shaohua Li <shaohua.li@intel.com> Cc: "Zhang, Yanmin" <yanmin.zhang@intel.com> Cc: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fec.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud