Naoya Horiguchi f4c18e6f7b mm: check __PG_HWPOISON separately from PAGE_FLAGS_CHECK_AT_*
The race condition addressed in commit add05cecef80 ("mm: soft-offline:
don't free target page in successful page migration") was not closed
completely, because that can happen not only for soft-offline, but also
for hard-offline.  Consider that a slab page is about to be freed into
buddy pool, and then an uncorrected memory error hits the page just
after entering __free_one_page(), then VM_BUG_ON_PAGE(page->flags &
PAGE_FLAGS_CHECK_AT_PREP) is triggered, despite the fact that it's not
necessary because the data on the affected page is not consumed.

To solve it, this patch drops __PG_HWPOISON from page flag checks at
allocation/free time.  I think it's justified because __PG_HWPOISON
flags is defined to prevent the page from being reused, and setting it
outside the page's alloc-free cycle is a designed behavior (not a bug.)

For recent months, I was annoyed about BUG_ON when soft-offlined page
remains on lru cache list for a while, which is avoided by calling
put_page() instead of putback_lru_page() in page migration's success
path.  This means that this patch reverts a major change from commit
add05cecef80 about the new refcounting rule of soft-offlined pages, so
"reuse window" revives.  This will be closed by a subsequent patch.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Dean Nelson <dnelson@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-08-07 04:39:42 +03:00
..
2015-07-17 16:39:53 -07:00
2015-04-22 09:24:55 -07:00
2015-06-25 11:49:31 +03:00
2015-06-26 14:51:15 -07:00
2015-06-03 14:13:41 +09:00
2015-05-31 13:40:53 +02:00
2015-07-02 11:32:23 -07:00
2015-05-13 12:04:55 -05:00
2015-07-07 22:48:25 +02:00
2015-03-25 20:28:11 -04:00
2015-06-02 08:33:34 -06:00
2015-04-17 09:03:53 -04:00
2015-06-01 14:35:56 -06:00
2015-02-12 18:54:15 -08:00
2015-05-05 13:35:39 -06:00
2015-06-24 17:49:45 -07:00
2015-05-12 10:46:53 +02:00
2015-06-01 14:33:35 +02:00
2015-06-19 15:18:28 +02:00
2015-03-16 21:45:54 +11:00
2015-05-05 13:40:42 -06:00
2015-06-23 18:27:19 -07:00
2015-06-25 12:06:45 +02:00
2015-04-29 17:17:17 -05:00
2015-04-14 16:49:05 -07:00
2015-03-25 11:44:52 +01:00
2015-06-24 17:49:41 -07:00
2015-06-25 04:20:04 -04:00
2015-05-09 22:15:31 -04:00
2015-07-04 14:04:44 -04:00
2015-06-05 10:58:34 -06:00
2015-07-01 19:40:18 -07:00
2015-03-11 17:56:28 -04:00
2015-07-01 19:40:18 -07:00
2015-04-12 21:03:31 +02:00
2015-06-19 01:18:14 +02:00
2015-06-12 11:36:30 +02:00
2015-06-10 19:14:04 +08:00
2015-05-27 12:58:04 -07:00
2015-05-26 15:23:23 +02:00
2015-06-25 01:13:43 +02:00
2015-06-23 18:01:07 -04:00
2015-06-29 10:49:51 -07:00
2015-02-13 21:21:41 -08:00
2015-04-11 15:53:35 -04:00
2015-04-16 19:02:04 -04:00
2015-06-25 17:00:40 -07:00
2015-05-19 09:19:59 -06:00
2015-06-25 17:00:39 -07:00
2015-05-18 14:08:58 -07:00
2015-05-29 17:21:45 -05:00
2015-04-11 22:29:44 -04:00
2015-04-14 18:06:47 -07:00
2015-06-12 17:26:57 -07:00
2015-06-29 11:10:56 -07:00
2015-03-24 09:48:14 -07:00
2015-06-25 17:00:37 -07:00
2015-04-15 16:35:20 -07:00