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=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 6003DC433E2 for ; Mon, 13 Jul 2020 07:52:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1446B20702 for ; Mon, 13 Jul 2020 07:52:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1446B20702 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 80DDB8D0006; Mon, 13 Jul 2020 03:52:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7969F8D0002; Mon, 13 Jul 2020 03:52:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 687198D0006; Mon, 13 Jul 2020 03:52:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 4E49B8D0002 for ; Mon, 13 Jul 2020 03:52:24 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DA7BB2C84 for ; Mon, 13 Jul 2020 07:52:23 +0000 (UTC) X-FDA: 77032284966.11.rake24_5c002d026ee6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id AFD03180F8B82 for ; Mon, 13 Jul 2020 07:52:23 +0000 (UTC) X-HE-Tag: rake24_5c002d026ee6 X-Filterd-Recvd-Size: 3074 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Mon, 13 Jul 2020 07:52:23 +0000 (UTC) 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 B2364ACE1; Mon, 13 Jul 2020 07:52:23 +0000 (UTC) Subject: Re: [PATCH v5 4/9] mm/migrate: clear __GFP_RECLAIM to make the migration callback consistent with regular THP allocations 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: <1594622517-20681-1-git-send-email-iamjoonsoo.kim@lge.com> <1594622517-20681-5-git-send-email-iamjoonsoo.kim@lge.com> From: Vlastimil Babka Message-ID: <367ca602-1112-f87f-7d2a-b0a75cce7269@suse.cz> Date: Mon, 13 Jul 2020 09:52:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1594622517-20681-5-git-send-email-iamjoonsoo.kim@lge.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: AFD03180F8B82 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 7/13/20 8:41 AM, js1304@gmail.com wrote: > From: Joonsoo Kim > > new_page_nodemask is a migration callback and it tries to use a common > gfp flags for the target page allocation whether it is a base page or a > THP. The later only adds GFP_TRANSHUGE to the given mask. This results > in the allocation being slightly more aggressive than necessary because > the resulting gfp mask will contain also __GFP_RECLAIM_KSWAPD. THP > allocations usually exclude this flag to reduce over eager background > reclaim during a high THP allocation load which has been seen during > large mmaps initialization. There is no indication that this is a > problem for migration as well but theoretically the same might happen > when migrating large mappings to a different node. Make the migration > callback consistent with regular THP allocations. > > Signed-off-by: Joonsoo Kim Acked-by: Vlastimil Babka Thanks! Typo below (I assume Andrew will fix it) > --- > mm/migrate.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/mm/migrate.c b/mm/migrate.c > index 3b3d918..1cfc965 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -1547,6 +1547,11 @@ struct page *new_page_nodemask(struct page *page, > } > > if (PageTransHuge(page)) { > + /* > + * clear __GFP_RECALIM to make the migration callback __GFP_RECLAIM > + * consistent with regular THP allocations. > + */ > + gfp_mask &= ~__GFP_RECLAIM; > gfp_mask |= GFP_TRANSHUGE; > order = HPAGE_PMD_ORDER; > } >