Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3881006ybi; Tue, 18 Jun 2019 07:59:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkjSrg1bLjQNESCzMPxpj+8Wh3L0DP4frqyNinQrDHegtAoYNhwNtxzji45b6hmQnX8MyJ X-Received: by 2002:a17:902:76c6:: with SMTP id j6mr89298765plt.263.1560869992989; Tue, 18 Jun 2019 07:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560869992; cv=none; d=google.com; s=arc-20160816; b=y5KdPLMlzpM3EmurArvzIy+hGi8Kt59vUjnXwWwQ1TX5HHf+nrgwxy/KWDTSdVmP2o nPgAeCPk2ABrUIXrPiFiGZnMmFJ5TlWEn06gLqiVClTdoYnelIy/GJ2FVfrhQJAOBrSZ YseECnN+Z1de0hKECFZH7Dp2p+kOStKn/cFvgcbbdknO1+sgm8xAryaNkueVIOSbikY4 jp8sEgNwzxHMgNr5AB3b6aHSIPTgvqOvw8mpFx19wZpRoG6p4Akuk70di96/PA40GpHj ZI261zVrHT8oi8pEVfggOgVduQU7OQwWI2sQ4aYzLy7lZFCv6BbGS6OCsolAp+6YwYQD kM7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=IrRkQLiiPOjM5QQUnELNR5Xw7wGDbfE12JYr/2t1OS0=; b=T1xhuojch01OB+cE663G+zqzgy/p1DHWoWzFibeLkRDdg54Lj7NYkeSsVWPbnrobWI KF1c4qS0dPV/fhNTVHeP++BNmpoISVuTz5+ztOXSimF2WWu3fas74F3/j1E+n6ZIHUgb HA9H+cBGlkm+oMKD51eX3fvON0CtpbmqWbbyWV+r2nPe8DVtt/LMUiCKSeswqpxokzGx XFxCC+OF9zZJFHej/qmhHvrYsJihFCqA4296bxz69O79X969s0Wh21EM7KQ+oFQtHiqo YuYYrGHqCD0pxq/sPXRL70X2TGbrfgKKHcQyH75/9SxmErF8mOuGJ+Fyu7bgMdG4lir2 ZKfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si14607859pfp.4.2019.06.18.07.59.37; Tue, 18 Jun 2019 07:59:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729507AbfFRO55 (ORCPT + 99 others); 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