diff options
author | Davidlohr Bueso <davidlohr@hp.com> | 2014-08-07 01:06:47 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 03:01:19 +0200 |
commit | ad4404a226ea92f2966f0e5378614e15ff4a7c76 (patch) | |
tree | 9c57a0c3429a45c881c10c7948bbd2daefba015c /mm/memory-failure.c | |
parent | mm,hugetlb: make unmap_ref_private() return void (diff) | |
download | linux-ad4404a226ea92f2966f0e5378614e15ff4a7c76.tar.xz 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 'mm/memory-failure.c')
0 files changed, 0 insertions, 0 deletions