aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2009-01-06 17:40:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:07 -0500
commit2509ef26db4699a5d9fa876e90ddfc107afcab84 (patch)
tree09e65185142c60b5d766d8b75f3cbc8a65de6a39 /include/linux/swap.h
parent22b31eec63e5f2e219a3ee15f456897272bc73e8 (diff)
badpage: zap print_bad_pte on swap and file
Complete zap_pte_range()'s coverage of bad pagetable entries by calling print_bad_pte() on a pte_file in a linear vma and on a bad swap entry. That needs free_swap_and_cache() to tell it, which will also have shown one of those "swap_free" errors (but with much less information). Similar checks in fork's copy_one_pte()? No, that would be more noisy than helpful: we'll see them when parent and child exec or exit. Where do_nonlinear_fault() calls print_bad_pte(): omit !VM_CAN_NONLINEAR case, that could only be a bug in sys_remap_file_pages(), not a bad pte. VM_FAULT_OOM rather than VM_FAULT_SIGBUS? Well, okay, that is consistent with what happens if do_swap_page() operates a bad swap entry; but don't we have patches to be more careful about killing when VM_FAULT_OOM? Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index cbf7fbed3dfd..91dee50fe260 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -302,7 +302,7 @@ extern swp_entry_t get_swap_page_of_type(int);
302extern int swap_duplicate(swp_entry_t); 302extern int swap_duplicate(swp_entry_t);
303extern int valid_swaphandles(swp_entry_t, unsigned long *); 303extern int valid_swaphandles(swp_entry_t, unsigned long *);
304extern void swap_free(swp_entry_t); 304extern void swap_free(swp_entry_t);
305extern void free_swap_and_cache(swp_entry_t); 305extern int free_swap_and_cache(swp_entry_t);
306extern int swap_type_of(dev_t, sector_t, struct block_device **); 306extern int swap_type_of(dev_t, sector_t, struct block_device **);
307extern unsigned int count_swap_pages(int, int); 307extern unsigned int count_swap_pages(int, int);
308extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); 308extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t);
@@ -352,14 +352,8 @@ static inline void show_swap_cache_info(void)
352{ 352{
353} 353}
354 354
355static inline void free_swap_and_cache(swp_entry_t swp) 355#define free_swap_and_cache(swp) is_migration_entry(swp)
356{ 356#define swap_duplicate(swp) is_migration_entry(swp)
357}
358
359static inline int swap_duplicate(swp_entry_t swp)
360{
361 return 0;
362}
363 357
364static inline void swap_free(swp_entry_t swp) 358static inline void swap_free(swp_entry_t swp)
365{ 359{