Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp968467ybt; Tue, 7 Jul 2020 04:50:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyktmrTJhO8tjayC5kVBi72J0m8+BRLlm5g1SpvCjHnsD2flUK+9hhFANnBl1rrsP/VA5Pk X-Received: by 2002:aa7:da4c:: with SMTP id w12mr48303025eds.122.1594122634924; Tue, 07 Jul 2020 04:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594122634; cv=none; d=google.com; s=arc-20160816; b=iCJ5bbthfk63u0sboy+2RPYdQVlb8IZrzW9KI9WgkFsGrtixFdHGMjqAmPyRsC6Ivq A44dANFOB2tGDPh8P3qxnwwV7smEg6dqUuhG2bVIAvGNhvuR/eAMJjXePAT9ITj1yCOx uUaYf03iHEk2DS8H1rCQf0m+QIvoFaPJxCCssFJmh6VTOo1lI2bdo84TGJZz1gIuZR/G ITS1XH8Ph1TYJ+NByDEoFzYem1WxYpYAXzTNAWjQz0p5hjJzSrOHlNqAzX/xUM9YymxO dTJiitDuky+288/xgfBFQ7u+t+Rv82BU3+X6PNFAJoQ9jvlf7HQQhgnxEfs9IpdSxRjI 1mnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=41aS1ZfHl6tQOcJ9IX63S3z+J1tFBqJh+v8HwkSGNXY=; b=OIiXlNtnmWmlhyVMXfbBQ6fBziEwOqTL7/rm8O0YjXKDbeYzbdm958qIpbKmMwWJ8D IiUxdlUx7M5ZSFTyzid5PThMSFh4qlwv0HEsJJAmi6wMJKoyzeD1S/dBYadFGTHMZx4W 5SS4j+nFvLlPoo7aJ153M9BJoW+3oagtGHgJUgwiBGbhJl+tdAuXuauAtnwo+wqhw2ql Yszsmk7jxrJaDhBqLinO2TRTf/IgB2xSjNvj9lXUZhcwalpfzDbyZMfOCEZLc0FqnTC8 4Z8YHLgo8zPcNdknjSPbImm4VsbySI1YC/KVwIf1fAIc+urSUFXJJW+D72M2RfjGNhjC xj5w== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg19si14431115ejb.138.2020.07.07.04.50.11; Tue, 07 Jul 2020 04:50:34 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728849AbgGGLsf (ORCPT + 99 others); Tue, 7 Jul 2020 07:48:35 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33950 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728609AbgGGLse (ORCPT ); Tue, 7 Jul 2020 07:48:34 -0400 Received: by mail-wr1-f68.google.com with SMTP id f7so41801983wrw.1 for ; Tue, 07 Jul 2020 04:48:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=41aS1ZfHl6tQOcJ9IX63S3z+J1tFBqJh+v8HwkSGNXY=; b=TFd6lu99C5AQPblhp57wa9uadaBkKg8ql7EBVSlzWhNhBVvp510OU/1FotztD9SywG p6EUEslXvX7klHBuc91bhudc8GWgISR2urimFg+nJ4XyKaGWy+504J7zOT8UVe2BWFfV 7UVOC46xuCduEHQV4ve/BScoTK6KTI38aGLSBrdwcttR1pNgRIC6RER1qwI5Gzlumg9/ rWFeKK0LmWZw7Z08S2IvFa9AYZ/qMKZRBatTZpV1ajKD28SUzxMrPnHRywdrXu438K14 kUEsnH5KQvmr6NjtukJcmT+C8xwONqVCMqPrAUONxolfqd8n/p36pCqDaCcqGhwbbv8z tCKw== X-Gm-Message-State: AOAM532nH9YbK/xvG+38dPBQH76mo6uANPLgs0WN0MNbPZm6CWZV7g3C i4oK+pmf8O2R+bvc8aYfFp8= X-Received: by 2002:a5d:4202:: with SMTP id n2mr52035653wrq.171.1594122511923; Tue, 07 Jul 2020 04:48:31 -0700 (PDT) Received: from localhost (ip-37-188-179-51.eurotel.cz. [37.188.179.51]) by smtp.gmail.com with ESMTPSA id l132sm778285wmf.6.2020.07.07.04.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 04:48:31 -0700 (PDT) Date: Tue, 7 Jul 2020 13:48:29 +0200 From: Michal Hocko To: js1304@gmail.com Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Joonsoo Kim Subject: Re: [PATCH v4 10/11] mm/memory-failure: remove a wrapper for alloc_migration_target() Message-ID: <20200707114829.GL5913@dhcp22.suse.cz> References: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> <1594107889-32228-11-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594107889-32228-11-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 07-07-20 16:44:48, Joonsoo Kim wrote: > From: Joonsoo Kim > > There is a well-defined standard migration target callback. Use it > directly. > > Signed-off-by: Joonsoo Kim > --- > 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, > + }; Is NUMA_NO_NODE really intended here? The original code has preferred to stay on the same node. If this is intentional then the changelog should be explicit about that. > > /* > * 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; > > -- > 2.7.4 > -- Michal Hocko SUSE Labs