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,URIBL_BLOCKED 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 D1F18C433E0 for ; Thu, 25 Jun 2020 12:10:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 992C02065D for ; Thu, 25 Jun 2020 12:10:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 992C02065D 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 470D76B005D; Thu, 25 Jun 2020 08:10:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 44A428D0002; Thu, 25 Jun 2020 08:10:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 339C56B0068; Thu, 25 Jun 2020 08:10:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 1D63B6B005D for ; Thu, 25 Jun 2020 08:10:44 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C8CDD824556B for ; Thu, 25 Jun 2020 12:10:43 +0000 (UTC) X-FDA: 76967617566.10.sleet57_2e168cf26e4c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 97A1A16A07F for ; Thu, 25 Jun 2020 12:10:43 +0000 (UTC) X-HE-Tag: sleet57_2e168cf26e4c X-Filterd-Recvd-Size: 4734 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 25 Jun 2020 12:10:43 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id j94so5618560wrj.0 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=OoqM6ukAiTf16sQ5YKgavKwdZ8koVPv84Pqi5Rx52drD+17+SWoI4dx9NmfSBwOkeE MgGDv2dM2UBtqyiam4G8fqBOaY6OTE2U4o6V5lJSklHJl+mhoqKNH5ERwKnW6SFYz8Mz qWxunnQ4Cxgyu/sPQCWdM2ZqLaiGfJgDKRbPI2xWDyEw4L19GYR6eMyR9U/ILdfYgjNx 1HPG5Wjv+P5xU4L2/SLkG+cfWuL+5tmAOZ/GUA2fPXaUb/h4oVBf3wI8ngmNZ7aFAGRt 7DlH38NX7LG45DkTAY6lGuKdT9+9w6IQvCAirj1lMPRYTagoNWNS3sRLWq7iXrLREKUM WYbw== X-Gm-Message-State: AOAM5313+T1ikgP6jCj3fqJ5dUWh3JYwPOH+IHtjziFHDZHn9lGmoboy w1iWvn+1xFcRQtkLNAhEEN9g3TJ6 X-Google-Smtp-Source: ABdhPJyyKGsttvq6Tk4qNTIvMe64IroJ2hLsykUfDz6vfqJVkJt7XYpLXOaMoOPg4ewfqSbthEa6nw== 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> X-Rspamd-Queue-Id: 97A1A16A07F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 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