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=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 31BACC433E0 for ; Tue, 7 Jul 2020 18:55:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EF3C5206E9 for ; Tue, 7 Jul 2020 18:55:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF3C5206E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7D74B8D0016; Tue, 7 Jul 2020 14:55:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7ADD38D0014; Tue, 7 Jul 2020 14:55:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 675BD8D0016; Tue, 7 Jul 2020 14:55:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id 4F7638D0014 for ; Tue, 7 Jul 2020 14:55:07 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E90931EF1 for ; Tue, 7 Jul 2020 18:55:06 +0000 (UTC) X-FDA: 77012182212.28.pan63_4508f3726eb6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id B21096D66 for ; Tue, 7 Jul 2020 18:55:06 +0000 (UTC) X-HE-Tag: pan63_4508f3726eb6 X-Filterd-Recvd-Size: 4748 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 18:55:06 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id o8so207265wmh.4 for ; Tue, 07 Jul 2020 11:55:06 -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=mxUeGdy8xixT3qR6TxhpxqIaXyQxpW6SR0YnzaRkS0E=; b=BosTvleM9hM73X1TtRbi3He6uzvW5w738+LyV/sidd9/yoxgT2MmQrPJU+prpEkWwY NFqKxDq8M3bhPW795DYDMrFgwzWVNN6w5aV9ajvvRMhzWOm8hyVe+bZ6+YsTisIJ+HQM JqFldhrm/R6E3GuXjbhfwks/LHQ9RTE1tvNfrq6GZSHH3iDes8FUX9iRRsJzsxUDYkOs TX+obV0lcesszuZ8vgB9WCq5drUv+g5rO4DUnWh6f3sYgA5UNkrqBdQL7FbM++Rrkd3z a54nNB2Ht0pozF7dwyMar65YufpLRK2VN4YAeqk/bTLXz8K0QLS8WR0Hj5iyGzM05PfX LdFQ== X-Gm-Message-State: AOAM530ezKx7wSDzWeg2juhpBsVzV5fXeo5LdzmxfTBBJyc/zE/oBzLe Ozmhf2rNomTyv9UyzAGcL2o= X-Google-Smtp-Source: ABdhPJzNRNscumqL6aBLKIQmg6e72dca5LxifBnolOifdcCPhbu8MufNepFv48LoRVlN3rBwq8rLxw== X-Received: by 2002:a05:600c:281:: with SMTP id 1mr5683217wmk.143.1594148105262; Tue, 07 Jul 2020 11:55:05 -0700 (PDT) Received: from localhost (ip-37-188-179-51.eurotel.cz. [37.188.179.51]) by smtp.gmail.com with ESMTPSA id b62sm2319785wmh.38.2020.07.07.11.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 11:55:04 -0700 (PDT) Date: Tue, 7 Jul 2020 20:55:03 +0200 From: Michal Hocko To: Vlastimil Babka Cc: js1304@gmail.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, 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: <20200707185503.GY5913@dhcp22.suse.cz> References: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> <1594107889-32228-11-git-send-email-iamjoonsoo.kim@lge.com> <20200707114829.GL5913@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: B21096D66 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 Tue 07-07-20 17:03:50, Vlastimil Babka wrote: > On 7/7/20 1:48 PM, Michal Hocko wrote: > > 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. > > The alloc_migration_target() interprets NUMA_NO_NODE as a request to call > page_to_nid(), so we don't need these thin wrappers that do just that. I have > suggested this in v3 review and it's mentioned in 06/11. Ohh, right. I just lost that piece of information on the way. It wouldn't hurt to keep page_to_nid here for readability though. -- Michal Hocko SUSE Labs