linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] Please pull hwpoison updates for 2.6.37
@ 2010-10-26 10:09 Andi Kleen
  2010-10-27  7:42 ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2010-10-26 10:09 UTC (permalink / raw)
  To: torvalds, linux-kernel, linux-mm; +Cc: n-horiguchi, x86


Linus,

Here are the hwpoison updates for 2.6.37. The main new feature is 
soft offlining support for huge pages: support to predictively offline 
hugepages based on corrected memory error statistics.  
This can be a large win in memory reliability in some setups
and is transparent to applications.
We already supported that for small pages, but now have it for 
large pages too, because some large memory users like to use those.

Thanks to Naoya-san for spending a lot of time on that
and also cleaning up some code on the way.

This also is the basis for generic huge page migration (most of
the infrastructure is there, but not fully hooked up yet), which
will also give some NUMA tuning benefits.

Also various cleanups and improvements to hwpoison code.

There are some changes outside the usual hwpoison files,
which were needed to implement these features:

Signals:
- IA64 signal fix for _addr_lsb. Similar to the earlier MIPS change.
Acked by Tony.
- signalfd.h fix (from Seto-san): Same fix as for ia64 for signalfd.
This is all really just to report the _addr_lsb siginfo field out to
user space, so that it knows how much memory got corrupted. 
The code for siginfo is unfortunately scattered all over
the tree and I didn't find anyone who felt responsible for it.

- x86 hwpoison signal reporting fix. I tried to get an ack for that,
but wasn't able to motivate the x86 maintainers to reply to their emails.
Basically just pass around the address granuality from handle_mm_fault
to the hwpoison code in fault.c when an error happens.

MM:
- Some fixes to handle_memory_fault() to pass out the error
granuality in the return code. Does not affect any non hwpoison path.
- Migration changes for huge pages.
The migration code has been reviewed extensively by Christoph Lameter.
- hugetlb changes for migration. Have been reviewed by Mel.
- rmap changes for hugetlb migration, including the cleanups you requested 
in the last review cycle. Acked by Rik and others.

Please consider pulling,

Thanks,
-Andi

The following changes since commit 72e58063d63c5f0a7bf65312f1e3a5ed9bb5c2ff:

  Merge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci (2010-10-25 10:59:31 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6.git hwpoison

Andi Kleen (14):
      Clean up __page_set_anon_rmap
      hugepage: move is_hugepage_on_freelist inside ifdef to avoid warning
      Encode huge page size for VM_FAULT_HWPOISON errors
      x86: HWPOISON: Report correct address granuality for huge hwpoison faults
      HWPOISON: Improve comments in memory-failure.c
      HWPOISON: Convert pr_debugs to pr_info
      HWPOISON: Disable DEBUG by default
      HWPOISON: Turn addr_valid from bitfield into char
      HWPOISON: Remove retry loop for try_to_unmap
      Fix migration.c compilation on s390
      Add _addr_lsb field to ia64 siginfo
      Merge branch 'hwpoison-fixes-2.6.37' into hwpoison
      Merge branch 'hwpoison-cleanups' into hwpoison
      Merge branch 'hwpoison-hugepages' into hwpoison

Hidetoshi Seto (1):
      HWPOISON/signalfd: add support for addr_lsb

Naoya Horiguchi (10):
      hugetlb: fix metadata corruption in hugetlb_fault()
      hugetlb: add allocate function for hugepage migration
      hugetlb: redefine hugepage copy functions
      hugetlb: hugepage migration core
      HWPOISON, hugetlb: add free check to dequeue_hwpoison_huge_page()
      hugetlb: move refcounting in hugepage allocation inside hugetlb_lock
      HWPOSION, hugetlb: recover from free hugepage error when !MF_COUNT_INCREASED
      HWPOISON, hugetlb: soft offlining for hugepage
      HWPOISON, hugetlb: fix unpoison for hugepage
      Fix build error with !CONFIG_MIGRATION

 arch/ia64/include/asm/siginfo.h |    1 +
 arch/x86/mm/fault.c             |   19 ++-
 fs/hugetlbfs/inode.c            |   15 +++
 fs/signalfd.c                   |   10 ++
 include/linux/hugetlb.h         |   17 +++-
 include/linux/migrate.h         |   16 +++
 include/linux/mm.h              |   12 ++-
 include/linux/signalfd.h        |    3 +-
 mm/hugetlb.c                    |  233 +++++++++++++++++++++++++++------------
 mm/memory-failure.c             |  175 +++++++++++++++++++++--------
 mm/memory.c                     |    3 +-
 mm/migrate.c                    |  234 ++++++++++++++++++++++++++++++++++++---
 mm/rmap.c                       |   25 ++---
 13 files changed, 596 insertions(+), 167 deletions(-)
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] Please pull hwpoison updates for 2.6.37
  2010-10-26 10:09 [GIT PULL] Please pull hwpoison updates for 2.6.37 Andi Kleen
@ 2010-10-27  7:42 ` Ingo Molnar
  2010-10-27  7:58   ` Andi Kleen
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2010-10-27  7:42 UTC (permalink / raw)
  To: Andi Kleen; +Cc: torvalds, linux-kernel, linux-mm, n-horiguchi, x86


* Andi Kleen <andi@firstfloor.org> wrote:

> [...]
>
> - x86 hwpoison signal reporting fix. I tried to get an ack for that,
>   but wasn't able to motivate the x86 maintainers to reply to their emails.

Hm, you sent it once two weeks before the merge window and we missed that.

Patch looks ok. (I'd personally not expose an #ifdef in the middle of a function 
like that but that's a detail that doesnt affect correctness.)

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] Please pull hwpoison updates for 2.6.37
  2010-10-27  7:42 ` Ingo Molnar
@ 2010-10-27  7:58   ` Andi Kleen
  2010-10-27  8:18     ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2010-10-27  7:58 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Andi Kleen, torvalds, linux-kernel, linux-mm, n-horiguchi, x86


Thanks for the review.

-Andi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] Please pull hwpoison updates for 2.6.37
  2010-10-27  7:58   ` Andi Kleen
@ 2010-10-27  8:18     ` Ingo Molnar
  2010-10-27  9:01       ` Andi Kleen
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2010-10-27  8:18 UTC (permalink / raw)
  To: Andi Kleen; +Cc: torvalds, linux-kernel, linux-mm, n-horiguchi, x86


* Andi Kleen <andi@firstfloor.org> wrote:

> * Ingo Molnar <mingo@elte.hu> wrote:
>
> > 
> > * Andi Kleen <andi@firstfloor.org> wrote:
> >
> > > [...]
> > >
> > > - x86 hwpoison signal reporting fix. I tried to get an ack for that,
> > >   but wasn't able to motivate the x86 maintainers to reply to their emails.
> > 
> > Hm, you sent it once two weeks before the merge window and we missed that.
> > 
> > Patch looks ok. (I'd personally not expose an #ifdef in the middle of a function 
> > like that but that's a detail that doesnt affect correctness.)
> > 
> > Thanks,
> 
> Thanks for the review.

You are welcome! How about the cleanliness feedback that i gave?
(the stuff in parentheses)

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] Please pull hwpoison updates for 2.6.37
  2010-10-27  8:18     ` Ingo Molnar
@ 2010-10-27  9:01       ` Andi Kleen
  2010-10-27  9:09         ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2010-10-27  9:01 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Andi Kleen, torvalds, linux-kernel, linux-mm, n-horiguchi, x86

> You are welcome! How about the cleanliness feedback that i gave?
> (the stuff in parentheses)

Could move the ifdef into mm.h for the flags and let the optimizer
eliminate the code. I can do that in a followup patch.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] Please pull hwpoison updates for 2.6.37
  2010-10-27  9:01       ` Andi Kleen
@ 2010-10-27  9:09         ` Ingo Molnar
  2010-10-27  9:21           ` Andi Kleen
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2010-10-27  9:09 UTC (permalink / raw)
  To: Andi Kleen; +Cc: torvalds, linux-kernel, linux-mm, n-horiguchi, x86


* Andi Kleen <andi@firstfloor.org> wrote:

> > You are welcome! How about the cleanliness feedback that i gave?
> > (the stuff in parentheses)
> 
> Could move the ifdef into mm.h for the flags and let the optimizer
> eliminate the code. I can do that in a followup patch.

Yeah. If it does not work out due to architectural differences then
do not push it too hard (the code is small enough) - we only want to
factor this out if it makes things cleaner.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] Please pull hwpoison updates for 2.6.37
  2010-10-27  9:09         ` Ingo Molnar
@ 2010-10-27  9:21           ` Andi Kleen
  0 siblings, 0 replies; 7+ messages in thread
From: Andi Kleen @ 2010-10-27  9:21 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Andi Kleen, torvalds, linux-kernel, linux-mm, n-horiguchi, x86

On Wed, Oct 27, 2010 at 11:09:03AM +0200, Ingo Molnar wrote:
> 
> * Andi Kleen <andi@firstfloor.org> wrote:
> 
> > > You are welcome! How about the cleanliness feedback that i gave?
> > > (the stuff in parentheses)
> > 
> > Could move the ifdef into mm.h for the flags and let the optimizer
> > eliminate the code. I can do that in a followup patch.
> 
> Yeah. If it does not work out due to architectural differences then
> do not push it too hard (the code is small enough) - we only want to
> factor this out if it makes things cleaner.

Here's the patch I came up with. I'll keep it in my tree for now.

-Andi

---

x86/HWPOISON: Move do_sigbus ifdef into header
    
Ingo asked for moving the MEMORY_FAILURE ifdef in the x86's
fault handler's do_sigbus elsewhere. This patch moves the
ifdef into mm.h by defining the HWPOISON return flags
of handle_mm_fault() to 0 if MEMORY_FAILURE is not enabled.
This way the optimizer can eliminate the code without ifdef.
    
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 852b319..8b76d79 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -812,14 +812,12 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
 	tsk->thread.error_code	= error_code;
 	tsk->thread.trap_no	= 14;
 
-#ifdef CONFIG_MEMORY_FAILURE
 	if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
 		printk(KERN_ERR
 	"MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n",
 			tsk->comm, tsk->pid, address);
 		code = BUS_MCEERR_AR;
 	}
-#endif
 	force_sig_info_fault(SIGBUS, code, address, tsk, fault);
 }
 
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a4c6684..d9a6af5 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -718,8 +718,13 @@ static inline int page_mapped(struct page *page)
 #define VM_FAULT_SIGBUS	0x0002
 #define VM_FAULT_MAJOR	0x0004
 #define VM_FAULT_WRITE	0x0008	/* Special case for get_user_pages */
+#ifdef CONFIG_MEMORY_FAILURE
 #define VM_FAULT_HWPOISON 0x0010	/* Hit poisoned small page */
 #define VM_FAULT_HWPOISON_LARGE 0x0020  /* Hit poisoned large page. Index encoded in upper bits */
+#else
+#define VM_FAULT_HWPOISON 0
+#define VM_FAULT_HWPOISON_LARGE 0
+#endif
 
 #define VM_FAULT_NOPAGE	0x0100	/* ->fault installed the pte, not return page */
 #define VM_FAULT_LOCKED	0x0200	/* ->fault locked the returned page */


-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-10-27  9:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-26 10:09 [GIT PULL] Please pull hwpoison updates for 2.6.37 Andi Kleen
2010-10-27  7:42 ` Ingo Molnar
2010-10-27  7:58   ` Andi Kleen
2010-10-27  8:18     ` Ingo Molnar
2010-10-27  9:01       ` Andi Kleen
2010-10-27  9:09         ` Ingo Molnar
2010-10-27  9:21           ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).