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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 C9483C4361B for ; Wed, 9 Dec 2020 10:25:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2AADB23B6B for ; Wed, 9 Dec 2020 10:25:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AADB23B6B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6ED8F8D0012; Wed, 9 Dec 2020 05:25:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 69DD18D000B; Wed, 9 Dec 2020 05:25:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B4618D0012; Wed, 9 Dec 2020 05:25:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id 431838D000B for ; Wed, 9 Dec 2020 05:25:35 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 098078249980 for ; Wed, 9 Dec 2020 10:25:35 +0000 (UTC) X-FDA: 77573362230.27.cars03_0b0ec86273ee Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id DFCB83D663 for ; Wed, 9 Dec 2020 10:25:34 +0000 (UTC) X-HE-Tag: cars03_0b0ec86273ee X-Filterd-Recvd-Size: 2953 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Dec 2020 10:25:34 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E21BDACF5; Wed, 9 Dec 2020 10:25:32 +0000 (UTC) Subject: Re: [PATCH] mm,hwpoison: Return -EBUSY when migration fails To: Oscar Salvador , akpm@linux-foundation.org Cc: n-horiguchi@ah.jp.nec.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Linux API References: <20201209092818.30417-1-osalvador@suse.de> From: Vlastimil Babka Message-ID: Date: Wed, 9 Dec 2020 11:25:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201209092818.30417-1-osalvador@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12/9/20 10:28 AM, Oscar Salvador wrote: > Currently, we return -EIO when we fail to migrate the page. > > Migrations' failures are rather transient as they can happen due to > several reasons, e.g: high page refcount bump, mapping->migrate_page > failing etc. > All meaning that at that time the page could not be migrated, but > that has nothing to do with an EIO error. > > Let us return -EBUSY instead, as we do in case we failed to isolate > the page. > > While are it, let us remove the "ret" print as its value does not change. > > Signed-off-by: Oscar Salvador Acked-by: Vlastimil Babka Technically this affects madvise(2) so let's cc linux-api. The manpage doesn't document error codes of MADV_HWPOISON and MADV_SOFT_OFFLINE (besides EPERM) though so nothing to adjust there. It's meant only for the hwpoison testing suite anyway. > --- > mm/memory-failure.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 428991e297e2..1942fb83ac64 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -1849,11 +1849,11 @@ static int __soft_offline_page(struct page *page) > pr_info("soft offline: %#lx: %s migration failed %d, type %lx (%pGp)\n", > pfn, msg_page[huge], ret, page->flags, &page->flags); > if (ret > 0) > - ret = -EIO; > + ret = -EBUSY; > } > } else { > - pr_info("soft offline: %#lx: %s isolation failed: %d, page count %d, type %lx (%pGp)\n", > - pfn, msg_page[huge], ret, page_count(page), page->flags, &page->flags); > + pr_info("soft offline: %#lx: %s isolation failed, page count %d, type %lx (%pGp)\n", > + pfn, msg_page[huge], page_count(page), page->flags, &page->flags); > ret = -EBUSY; > } > return ret; >