Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1188162ybt; Tue, 7 Jul 2020 09:37:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQTaEdzYz63WUrk9D2AYO2Zv23QJ+1A/UOBft70bzOF8RoFaKhzPTBbP2Elxnpbq35RFJu X-Received: by 2002:a05:6402:706:: with SMTP id w6mr60694135edx.326.1594139862574; Tue, 07 Jul 2020 09:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594139862; cv=none; d=google.com; s=arc-20160816; b=obUNENixwLw8gA/7rEWUFdmdD3watRdOknbPph2QbVtQubAfwaIjTjPO9Ho/H3jOlO iim4dVvQGW8NUmk1l90iuv3xTHEeZ0EZx0VlmZVkrGt/Kl0x3M6tAZx2xdhps1vNLiS8 HUk9sEbOSSrTch/gKnz06Q5gwbqskAOv1AVg+02zpAqqmQ9GkDzVgzE++CxbLgJqpjCw bKAWq6SNQk9lIf5VTUJ/yPas3KVamFX4lOoeCwNStgrZ/QvB65m2RBVyH5xBMz4CBPk8 7GVOHhfJ5SQ4P8oBe1raL8xcT8n77kXMVnHMSnYmFu2XIFCDm4mwS1oRVr1ZD4wOX/n6 pD4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=I3D0JvTU2YMhlDr2MY5+LiujWEBvXK9gtTFjERqgd2w=; b=Arm/Oqk9aM799DFfmqB3tX/GnziB6RYuq+st/uGPher3FZHYT7chmTqK8ZnqNRepO/ Cyo0D8xN36ieea98dRq6Q0fRsMn2xceeUb+SSv1AAMkXgXyWBADOopysPe6WLb63tOxp 1P9kqtrBGp26nfaEYX/OhxSR40L238YjFcVSjVswh5VaoXWWbsNMd4Fhh99E7Qpv1lN3 XML9jBvXZdbDLl/73o0X6gOdz+lY+h3/jguGkt6eeZ8zg0kn13W6f7mEZXm1yY4JNUjS 28ba++vYqxSki1VLAjqbakWm4+/gs5K+vC7AxKN5QXWV8anMTr6d7LkFGghyD6sqicYW 3ZnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz15si15029430ejb.406.2020.07.07.09.37.19; Tue, 07 Jul 2020 09:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728295AbgGGQeQ (ORCPT + 99 others); Tue, 7 Jul 2020 12:34:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:45550 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbgGGQeI (ORCPT ); Tue, 7 Jul 2020 12:34:08 -0400 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 59423B007; Tue, 7 Jul 2020 16:34:07 +0000 (UTC) Subject: Re: [PATCH v4 10/11] mm/memory-failure: remove a wrapper for alloc_migration_target() To: js1304@gmail.com, Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Michal Hocko , Joonsoo Kim References: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> <1594107889-32228-11-git-send-email-iamjoonsoo.kim@lge.com> From: Vlastimil Babka Message-ID: <7a0c02ca-5354-2508-a8a1-ff80d413af59@suse.cz> Date: Tue, 7 Jul 2020 17:00:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <1594107889-32228-11-git-send-email-iamjoonsoo.kim@lge.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/7/20 9:44 AM, js1304@gmail.com wrote: > From: Joonsoo Kim > > There is a well-defined standard migration target callback. Use it > directly. > > Signed-off-by: Joonsoo Kim Acked-by: Vlastimil Babka > --- > mm/memory-failure.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 609d42b6..3b89804 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -1677,16 +1677,6 @@ int unpoison_memory(unsigned long pfn) > } > EXPORT_SYMBOL(unpoison_memory); > > -static struct page *new_page(struct page *p, unsigned long private) > -{ > - struct migration_target_control mtc = { > - .nid = page_to_nid(p), > - .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, > - }; > - > - return alloc_migration_target(p, (unsigned long)&mtc); > -} > - > /* > * Safely get reference count of an arbitrary page. > * Returns 0 for a free page, -EIO for a zero refcount page > @@ -1793,6 +1783,10 @@ static int __soft_offline_page(struct page *page) > const char *msg_page[] = {"page", "hugepage"}; > bool huge = PageHuge(page); > LIST_HEAD(pagelist); > + struct migration_target_control mtc = { > + .nid = NUMA_NO_NODE, > + .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, > + }; > > /* > * Check PageHWPoison again inside page lock because PageHWPoison > @@ -1829,8 +1823,8 @@ static int __soft_offline_page(struct page *page) > } > > if (isolate_page(hpage, &pagelist)) { > - ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL, > - MIGRATE_SYNC, MR_MEMORY_FAILURE); > + ret = migrate_pages(&pagelist, alloc_migration_target, NULL, > + (unsigned long)&mtc, MIGRATE_SYNC, MR_MEMORY_FAILURE); > if (!ret) { > bool release = !huge; > >