Re: [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-horiguchi@xxxxxxxxxxxxx>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]