Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Oct 2010 17:13:10 +0000 (10:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Oct 2010 17:13:10 +0000 (10:13 -0700)
* 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6: (22 commits)
  Add _addr_lsb field to ia64 siginfo
  Fix migration.c compilation on s390
  HWPOISON: Remove retry loop for try_to_unmap
  HWPOISON: Turn addr_valid from bitfield into char
  HWPOISON: Disable DEBUG by default
  HWPOISON: Convert pr_debugs to pr_info
  HWPOISON: Improve comments in memory-failure.c
  x86: HWPOISON: Report correct address granuality for huge hwpoison faults
  Encode huge page size for VM_FAULT_HWPOISON errors
  Fix build error with !CONFIG_MIGRATION
  hugepage: move is_hugepage_on_freelist inside ifdef to avoid warning
  Clean up __page_set_anon_rmap
  HWPOISON, hugetlb: fix unpoison for hugepage
  HWPOISON, hugetlb: soft offlining for hugepage
  HWPOSION, hugetlb: recover from free hugepage error when !MF_COUNT_INCREASED
  hugetlb: move refcounting in hugepage allocation inside hugetlb_lock
  HWPOISON, hugetlb: add free check to dequeue_hwpoison_huge_page()
  hugetlb: hugepage migration core
  hugetlb: redefine hugepage copy functions
  hugetlb: add allocate function for hugepage migration
  ...

1  2 
fs/hugetlbfs/inode.c
fs/signalfd.c
mm/rmap.c

diff --combined fs/hugetlbfs/inode.c
index 113eba3d3c386e139453abedb72f1da8dc844097,1f7ca505d48e52a2a86f6884580aa07bc07dbf6d..a14328d270e855a4d16d3772b9ad464bab296bdc
@@@ -31,6 -31,7 +31,7 @@@
  #include <linux/statfs.h>
  #include <linux/security.h>
  #include <linux/magic.h>
+ #include <linux/migrate.h>
  
  #include <asm/uaccess.h>
  
@@@ -573,6 -574,19 +574,19 @@@ static int hugetlbfs_set_page_dirty(str
        return 0;
  }
  
+ static int hugetlbfs_migrate_page(struct address_space *mapping,
+                               struct page *newpage, struct page *page)
+ {
+       int rc;
+       rc = migrate_huge_page_move_mapping(mapping, newpage, page);
+       if (rc)
+               return rc;
+       migrate_page_copy(newpage, page);
+       return 0;
+ }
  static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf)
  {
        struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb);
@@@ -659,6 -673,7 +673,7 @@@ static const struct address_space_opera
        .write_begin    = hugetlbfs_write_begin,
        .write_end      = hugetlbfs_write_end,
        .set_page_dirty = hugetlbfs_set_page_dirty,
+       .migratepage    = hugetlbfs_migrate_page,
  };
  
  
@@@ -674,7 -689,6 +689,7 @@@ const struct file_operations hugetlbfs_
        .mmap                   = hugetlbfs_file_mmap,
        .fsync                  = noop_fsync,
        .get_unmapped_area      = hugetlb_get_unmapped_area,
 +      .llseek         = default_llseek,
  };
  
  static const struct inode_operations hugetlbfs_dir_inode_operations = {
diff --combined fs/signalfd.c
index 74047304b01a4300bf7f781ad4d2838dc3bc316b,bdd4496ae67fb8e423820c8acb798154a5c55ba2..492465b451ddd34f6f60214fb48224687649faa9
@@@ -98,6 -98,16 +98,16 @@@ static int signalfd_copyinfo(struct sig
                err |= __put_user((long) kinfo->si_addr, &uinfo->ssi_addr);
  #ifdef __ARCH_SI_TRAPNO
                err |= __put_user(kinfo->si_trapno, &uinfo->ssi_trapno);
+ #endif
+ #ifdef BUS_MCEERR_AO
+               /* 
+                * Other callers might not initialize the si_lsb field,
+                * so check explicitly for the right codes here.
+                */
+               if (kinfo->si_code == BUS_MCEERR_AR ||
+                   kinfo->si_code == BUS_MCEERR_AO)
+                       err |= __put_user((short) kinfo->si_addr_lsb,
+                                         &uinfo->ssi_addr_lsb);
  #endif
                break;
        case __SI_CHLD:
@@@ -206,7 -216,6 +216,7 @@@ static const struct file_operations sig
        .release        = signalfd_release,
        .poll           = signalfd_poll,
        .read           = signalfd_read,
 +      .llseek         = noop_llseek,
  };
  
  SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
diff --combined mm/rmap.c
index 5f17fad1bee8bfcd6281fd955f21019480651d94,8adc6e3b09b3d03130b86fb6a5f7a3bb7741d524..f5ad996a4a8f76615d1f383fde5e4a783375a7b7
+++ b/mm/rmap.c
@@@ -745,7 -745,7 +745,7 @@@ int page_mkclean(struct page *page
                if (mapping) {
                        ret = page_mkclean_file(mapping, page);
                        if (page_test_dirty(page)) {
 -                              page_clear_dirty(page);
 +                              page_clear_dirty(page, 1);
                                ret = 1;
                        }
                }
@@@ -780,10 -780,10 +780,10 @@@ void page_move_anon_rmap(struct page *p
  }
  
  /**
-  * __page_set_anon_rmap - setup new anonymous rmap
-  * @page:     the page to add the mapping to
-  * @vma:      the vm area in which the mapping is added
-  * @address:  the user virtual address mapped
+  * __page_set_anon_rmap - set up new anonymous rmap
+  * @page:     Page to add to rmap     
+  * @vma:      VM area to add page to.
+  * @address:  User virtual address of the mapping     
   * @exclusive:        the page is exclusively owned by the current process
   */
  static void __page_set_anon_rmap(struct page *page,
  
        BUG_ON(!anon_vma);
  
+       if (PageAnon(page))
+               return;
        /*
         * If the page isn't exclusively mapped into this vma,
         * we must use the _oldest_ possible anon_vma for the
         * page mapping!
         */
-       if (!exclusive) {
-               if (PageAnon(page))
-                       return;
+       if (!exclusive)
                anon_vma = anon_vma->root;
-       } else {
-               /*
-                * In this case, swapped-out-but-not-discarded swap-cache
-                * is remapped. So, no need to update page->mapping here.
-                * We convice anon_vma poitned by page->mapping is not obsolete
-                * because vma->anon_vma is necessary to be a family of it.
-                */
-               if (PageAnon(page))
-                       return;
-       }
  
        anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
        page->mapping = (struct address_space *) anon_vma;
@@@ -942,7 -933,7 +933,7 @@@ void page_remove_rmap(struct page *page
         * containing the swap entry, but page not yet written to swap.
         */
        if ((!PageAnon(page) || PageSwapCache(page)) && page_test_dirty(page)) {
 -              page_clear_dirty(page);
 +              page_clear_dirty(page, 1);
                set_page_dirty(page);
        }
        /*