From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93744C31E5B for ; Tue, 18 Jun 2019 14:57:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67F8121479 for ; Tue, 18 Jun 2019 14:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729718AbfFRO55 (ORCPT ); Tue, 18 Jun 2019 10:57:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:42490 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729042AbfFRO54 (ORCPT ); Tue, 18 Jun 2019 10:57:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B2F8EAD81; Tue, 18 Jun 2019 14:57:55 +0000 (UTC) Date: Tue, 18 Jun 2019 16:57:52 +0200 From: Oscar Salvador To: Naoya Horiguchi Cc: linux-mm@kvack.org, Andrew Morton , Michal Hocko , Mike Kravetz , xishi.qiuxishi@alibaba-inc.com, "Chen, Jerry T" , "Zhuo, Qiuxu" , linux-kernel@vger.kernel.org, Anshuman Khandual Subject: Re: [PATCH v3 1/2] mm: soft-offline: return -EBUSY if set_hwpoison_free_buddy_page() fails Message-ID: <20190618145748.GA14817@linux> References: <1560761476-4651-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1560761476-4651-2-git-send-email-n-horiguchi@ah.jp.nec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1560761476-4651-2-git-send-email-n-horiguchi@ah.jp.nec.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 05:51:15PM +0900, Naoya Horiguchi wrote: > The pass/fail of soft offline should be judged by checking whether the > raw error page was finally contained or not (i.e. the result of > set_hwpoison_free_buddy_page()), but current code do not work like that. > So this patch is suggesting to fix it. > > Without this fix, there are cases where madvise(MADV_SOFT_OFFLINE) may > not offline the original page and will not return an error. It might > lead us to misjudge the test result when set_hwpoison_free_buddy_page() > actually fails. > > Signed-off-by: Naoya Horiguchi > Fixes: 6bc9b56433b76 ("mm: fix race on soft-offlining") > Cc: # v4.19+ Reviewed-by: Oscar Salvador > --- > ChangeLog v2->v3: > - update patch description to clarify user visible change > --- > mm/memory-failure.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git v5.2-rc4/mm/memory-failure.c v5.2-rc4_patched/mm/memory-failure.c > index 8da0334..8ee7b16 100644 > --- v5.2-rc4/mm/memory-failure.c > +++ v5.2-rc4_patched/mm/memory-failure.c > @@ -1730,6 +1730,8 @@ static int soft_offline_huge_page(struct page *page, int flags) > if (!ret) { > if (set_hwpoison_free_buddy_page(page)) > num_poisoned_pages_inc(); > + else > + ret = -EBUSY; > } > } > return ret; > -- > 2.7.0 > -- Oscar Salvador SUSE L3