Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1395717ybt; Thu, 25 Jun 2020 05:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgYHP6OrbiK6cbfRUn7PIec5dpNUW/8CqzsWVzddRBXiH5xbXLf/0Oe/48aqFpHsMlkbNU X-Received: by 2002:aa7:c9c9:: with SMTP id i9mr31005306edt.166.1593087126239; Thu, 25 Jun 2020 05:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593087126; cv=none; d=google.com; s=arc-20160816; b=JMWZeFyfMliBQg3QrzdpGUHEmJqZskEGlBoLy/gimTPiM8ZCSH8MK+/anKNQcITcH9 fyrLTObx8wp4Wv78Xr3RyDU9oK3/YUWo+v6zRMhRrm9XSOxsYN/t3n1oME5cyEUK94km TEfKXWnIAOuzKMg41wOIB4i9cyQ8QYnHHXnQ7pUvtifrkCkdUcvi4qVvNBisdt4KhAY8 TiyP8UO+2aVAtOrdxl8mXGBhV3UVqGKkFX4HGMsuZmglzWCkEUz7j7wBOHZkDaVx5Puz lPSAH+ZdXvDurlN76tD6Q+Shb5H875EU3q00TDfhqgbWznHYhebvjxFHQvSTSBXxylou 36OQ== 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=0jbXkZNbg4noEr6B97w1ewenuEm0dXI4GSPALq5mbo8=; b=AyOGXuo25VCC4Tnr/BUiKKBE+oCuhgUC8J9uXvELSmE3LC4AcNdgKIVdnSzEkhNjSf kNH7p+YUBmjKqYS9+g2HyC/iaSDuXn3O+2VPLX/TUDdP2TQNMqX+84eMf4EpSgDMp5K7 vbu13/Cll9HSdhsYABUgZ03GobvwFu26yJqHZ5wW1Kld3kqittWy1g+0G7mHPsmDHWEj B9zeD9ysl9nY1VAHkI2Md/x6Le9tjGefg/+ht0rHD0DZsVscQSxJyCQsVMY9XGyJ2aRv u+jE3fm+rFk/LXhqp7+eMGabt3N7NM8kiqGbeeGhQUacGTCf8xEXl4joEkF2ibiTHSbg +fmA== 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 cn9si4202248edb.325.2020.06.25.05.11.42; Thu, 25 Jun 2020 05:12:06 -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 S2404518AbgFYMKo (ORCPT + 99 others); Thu, 25 Jun 2020 08:10:44 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40661 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404309AbgFYMKo (ORCPT ); Thu, 25 Jun 2020 08:10:44 -0400 Received: by mail-wr1-f68.google.com with SMTP id h5so5586695wrc.7 for ; Thu, 25 Jun 2020 05:10:42 -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=0jbXkZNbg4noEr6B97w1ewenuEm0dXI4GSPALq5mbo8=; b=iE96msYmeVSLIirTJzDORaR44og3dy/l7nHsnIxZ1q8EMY6GLMxHKihOPuO/07P7Lo e5u+hE2QhFH2cpo1zvWwrtRZm8RrFUmPXyHvBAzv51tXFLTyWBrQnQjniy2qjE4X/f+n yA/blOBy/3kOTnBCVfgAXAJ+FWx4Dd4NuwvUQqBghGE03gJcyjMFTtS602O3S460230Q aXE2trMoe1wifZTywU+yoahK/e1Pb9V9mfraSRaOmvH0WtR6YL1mxtJwZf8Z3qmNegZS MX876xATiQ3a+c02zNNkXLM3qmlLfB2+h/lYBrbkgaHoJAT19w4q0iOUdOUW4o86aCdb qdWA== X-Gm-Message-State: AOAM530HbX+X9qOLd+O0wIY7cgTePwYrhwFh3pqM2MeVKpFe9e3WcEFy aIize0rYu2UFKWOUWzJic08= X-Received: by 2002:adf:8168:: with SMTP id 95mr36045331wrm.104.1593087042114; Thu, 25 Jun 2020 05:10:42 -0700 (PDT) Received: from localhost (ip-37-188-168-3.eurotel.cz. [37.188.168.3]) by smtp.gmail.com with ESMTPSA id o29sm23743756wra.5.2020.06.25.05.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 05:10:41 -0700 (PDT) Date: Thu, 25 Jun 2020 14:10:40 +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 v3 8/8] mm/page_alloc: remove a wrapper for alloc_migration_target() Message-ID: <20200625121040.GI1320@dhcp22.suse.cz> References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-9-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1592892828-1934-9-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 23-06-20 15:13:48, Joonsoo Kim wrote: > From: Joonsoo Kim > > There is a well-defined standard migration target callback. > Use it directly. > > Signed-off-by: Joonsoo Kim Acked-by: Michal Hocko > --- > mm/page_alloc.c | 9 +++++++-- > mm/page_isolation.c | 11 ----------- > 2 files changed, 7 insertions(+), 13 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 9808339..884dfb5 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -8359,6 +8359,11 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, > unsigned long pfn = start; > unsigned int tries = 0; > int ret = 0; > + struct migration_target_control mtc = { > + .nid = zone_to_nid(cc->zone), > + .nmask = &node_states[N_MEMORY], > + .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, > + }; > > migrate_prep(); > > @@ -8385,8 +8390,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, > &cc->migratepages); > cc->nr_migratepages -= nr_reclaimed; > > - ret = migrate_pages(&cc->migratepages, alloc_migrate_target, > - NULL, 0, cc->mode, MR_CONTIG_RANGE); > + ret = migrate_pages(&cc->migratepages, alloc_migration_target, > + NULL, (unsigned long)&mtc, cc->mode, MR_CONTIG_RANGE); > } > if (ret < 0) { > putback_movable_pages(&cc->migratepages); > diff --git a/mm/page_isolation.c b/mm/page_isolation.c > index adba031..242c031 100644 > --- a/mm/page_isolation.c > +++ b/mm/page_isolation.c > @@ -306,14 +306,3 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn, > > return pfn < end_pfn ? -EBUSY : 0; > } > - > -struct page *alloc_migrate_target(struct page *page, unsigned long private) > -{ > - struct migration_target_control mtc = { > - .nid = page_to_nid(page), > - .nmask = &node_states[N_MEMORY], > - .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, > - }; > - > - return alloc_migration_target(page, (unsigned long)&mtc); > -} > -- > 2.7.4 -- Michal Hocko SUSE Labs