summaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr@hp.com>2014-08-06 16:06:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 18:01:19 -0700
commitad4404a226ea92f2966f0e5378614e15ff4a7c76 (patch)
tree9c57a0c3429a45c881c10c7948bbd2daefba015c /kernel/panic.c
parent2f4612af43d4854c892f5ef8ed7a98b6492aee44 (diff)
downloadblackbird-op-linux-ad4404a226ea92f2966f0e5378614e15ff4a7c76.tar.gz
blackbird-op-linux-ad4404a226ea92f2966f0e5378614e15ff4a7c76.zip
mm,hugetlb: simplify error handling in hugetlb_cow()
When returning from hugetlb_cow(), we always (1) put back the refcount for each referenced page -- always 'old', and 'new' if allocation was successful. And (2) retake the page table lock right before returning, as the callers expects. This logic can be simplified and encapsulated, as proposed in this patch. In addition to cleaner code, we also shave a few bytes off the instruction text: text data bss dec hex filename 28399 462 41328 70189 1122d mm/hugetlb.o-baseline 28367 462 41328 70157 1120d mm/hugetlb.o-patched Passes libhugetlbfs testcases. Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Cc: Aswin Chandramouleeswaran <aswin@hp.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/panic.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud