diff options
author | Davidlohr Bueso <davidlohr@hp.com> | 2014-08-06 16:06:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 18:01:19 -0700 |
commit | ad4404a226ea92f2966f0e5378614e15ff4a7c76 (patch) | |
tree | 9c57a0c3429a45c881c10c7948bbd2daefba015c /lib/locking-selftest.c | |
parent | 2f4612af43d4854c892f5ef8ed7a98b6492aee44 (diff) | |
download | blackbird-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 'lib/locking-selftest.c')
0 files changed, 0 insertions, 0 deletions