On Thu, Jul 30, 2015 at 10:52:46AM +0800, Wang Xiaoqiang wrote:
...
> In your example, the 100th subage enter the memory
> error handler firstly, and then it uses the 
> set_page_hwpoison_huge_page to set all subpages
> with PG_HWPoison flag, the 50th page handler waits
> for grab the lock_page(hpage) now. 
> 
> When the 100th page handler unlock the 'hpage', 
> the 50th grab it, and now the 'hapge' has been 
> set with PG_HWPosison. So PageHWPoison micro 
> will return true, and the following code will
> be executed:
> 
> if (PageHWPoison(hpage)) {
>     if ((hwpoison_filter(p) && TestClearPageHWPoison(p))
>         || (p != hpage && TestSetPageHWPoison(hpage))) {
>         atomic_long_sub(nr_pages, &num_poisoned_pages);
>         unlock_page(hpage);
>         return 0;
>     }   
> }
> 
> Now 'p' is 50th subpage, it doesn't equal the 
> 'hpage' obviously, so if we don't have TestSetPageHWPoison
> here, it still will ignore the 50th error.
Ah, you're right, thanks for the explanation, Xiaoqiang!

Acked-by: Naoya Horiguchi <n-horigu...@ah.jp.nec.com>--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to