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=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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=unavailable 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 2A1CBC433FE for ; Wed, 9 Dec 2020 10:01:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C49962343F for ; Wed, 9 Dec 2020 10:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729631AbgLIKAr (ORCPT ); Wed, 9 Dec 2020 05:00:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47654 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729523AbgLIKAg (ORCPT ); Wed, 9 Dec 2020 05:00:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607507949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2GxwxnmMdHRae5ypkeJWwVKnRG7S2cikV1jPIplwOtU=; b=BBDc1pXyebAUrxDCC4PobBNCn+IwcfaNv4+2XBDXhKdcPoo5LpMq4tV+Tx6EAh47PvzKOi N/xHSvj9lwFVTPWOyJgiec/WIVOda3Cso/BZS3a4aV76UGJkBCEFZC5sc6jEga96VOLibF aeEOHxpQzKBafKLC53OeCmnGReXJmRE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-EElVnxAvOXaOgb6CSy9r8A-1; Wed, 09 Dec 2020 04:59:07 -0500 X-MC-Unique: EElVnxAvOXaOgb6CSy9r8A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6447210054FF; Wed, 9 Dec 2020 09:59:06 +0000 (UTC) Received: from [10.36.114.167] (ovpn-114-167.ams2.redhat.com [10.36.114.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D3555D9E4; Wed, 9 Dec 2020 09:59:04 +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, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20201209092818.30417-1-osalvador@suse.de> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Wed, 9 Dec 2020 10:59:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.12.20 10:28, 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 > --- > 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; Do we expect callers to retry immediately? -EAGAIN might make also sense. But -EBUSY is an obvious improvement. Do we have callers relying on this behavior? -- Thanks, David / dhildenb