diff options
author | Andi Kleen <ak@linux.intel.com> | 2010-10-06 15:45:00 -0400 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2010-10-08 03:32:46 -0400 |
commit | aa50d3a7aa8147b9e14dc9d5972a5d2359db4ef8 (patch) | |
tree | 68fae5060333dcc24c17e9dd00a87bd760d883e9 /mm/memory.c | |
parent | 6f39ce056ab2ab2d29b2fae4aed61ed0b485972f (diff) |
Encode huge page size for VM_FAULT_HWPOISON errors
This fixes a problem introduced with the hugetlb hwpoison handling
The user space SIGBUS signalling wants to know the size of the hugepage
that caused a HWPOISON fault.
Unfortunately the architecture page fault handlers do not have easy
access to the struct page.
Pass the information out in the fault error code instead.
I added a separate VM_FAULT_HWPOISON_LARGE bit for this case and encode
the hpage index in some free upper bits of the fault code. The small
page hwpoison keeps stays with the VM_FAULT_HWPOISON name to minimize
changes.
Also add code to hugetlb.h to convert that index into a page shift.
Will be used in a further patch.
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: fengguang.wu@intel.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c index 0e18b4d649ec..c2d6dd315659 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1450,7 +1450,8 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1450 | if (ret & VM_FAULT_OOM) | 1450 | if (ret & VM_FAULT_OOM) |
1451 | return i ? i : -ENOMEM; | 1451 | return i ? i : -ENOMEM; |
1452 | if (ret & | 1452 | if (ret & |
1453 | (VM_FAULT_HWPOISON|VM_FAULT_SIGBUS)) | 1453 | (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE| |
1454 | VM_FAULT_SIGBUS)) | ||
1454 | return i ? i : -EFAULT; | 1455 | return i ? i : -EFAULT; |
1455 | BUG(); | 1456 | BUG(); |
1456 | } | 1457 | } |