Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp758907ybh; Sun, 12 Jul 2020 23:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxksnvMFoY7l8l6TsXq/X2Q3BVnwF61PEdQo7gMVz3PXP8S1gtNv6XFyxK2qRYVQcyqvz7a X-Received: by 2002:a50:d9cb:: with SMTP id x11mr85943901edj.93.1594622605515; Sun, 12 Jul 2020 23:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594622605; cv=none; d=google.com; s=arc-20160816; b=zy2oxa2LbU0NXFT6U+Lr15PQkcD16nBlQdfwh0hnA38Qbi4RfNSiidLZ7M2y4/DoFK PDF11BMKDe/ESehW2PabEQGeY+DyTtlJedH0jlKFtqytDPZJFffDXBTw8KlHKIMgCMGk vv8pD3Hhg3cW3lIJo2gdIq1iXWb5Xx/J6chaboBjHXndudnXF0SGGPwDWvzejX4YOnu+ Q108jJzaqyRkyXiFB6ldELZh38d5x+KbYyGwHcJjjK56DetneaByr6IcGYFCSGlMxpBL cIOlvJC+0McLlPCXdfT7eCLsj/n8rKNsxWrW8u1rLzoDV5A+EHfdB/DdO9md/JgpxYZp MlZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DYvbIUGr1klvf1KuM5X3vtjsbtYe5Ed8VKuo0vY8aNs=; b=ivf1x2FpzQOzTOKlu7TQHPquGTtvP+sp9zHWzi20bxUWDLxrG93nvRksZneFAzEwqf K3BT2q0Pnuj/6EMbt8kHjBxmVD5ot22BXWtzsCzyPhuGIfQHryIhXHVBgQuOu5es43b+ 8vv7wjV/bLkHevS8cdnYexQI/eMffc7eGqyFSwrmt9HzujmkeP9+536WtdxZr17TNa20 iYbDldRv2jxto5WVEBanVDhEIYZoCrLwrHqNYxqQGTc7haMr7KxgyFtzuCifbufyO0X4 3s6sYAzC4pEukyy6Ds9ghgZcDL3sxJH+o8PvaO768mTswl6S3CCIbs74JVfTy0GlZ438 zTCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CgBe3t8n; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx22si7999548ejb.148.2020.07.12.23.43.03; Sun, 12 Jul 2020 23:43:25 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CgBe3t8n; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729455AbgGMGma (ORCPT + 99 others); Mon, 13 Jul 2020 02:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729350AbgGMGm2 (ORCPT ); Mon, 13 Jul 2020 02:42:28 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7619C061794 for ; Sun, 12 Jul 2020 23:42:28 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id x8so5083464plm.10 for ; Sun, 12 Jul 2020 23:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DYvbIUGr1klvf1KuM5X3vtjsbtYe5Ed8VKuo0vY8aNs=; b=CgBe3t8n7VNso1NPJiLgJXeLW3cIBJizUgkVaI8dO5owHBrbFC4uG+U4un4Kgm6Hyv LiiwhzvpRqGbzWmLMdTelDCH+srgcqedru314ibXq61m3uTaO5hXbPSTxRpO1i1kmntP ExKG+iPC+sYXYNhqFeXc0cPb9Ls/83S7YUmSg+0htTsneBykEZOBiAu5Livcf5m7qsQV HOOdS0qo2GOdbKZxzBBq/8DuKxts+c9dAc/r8lAnO0Iq1pzjRh1CulVrFtb/n7EMo69m vzeRmYEJgpczLoBjmaatUyoy2CrcZoupto848VUZPY2y3Y41X5LrQ7s1GEHVR1WLh/Ju Rkqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DYvbIUGr1klvf1KuM5X3vtjsbtYe5Ed8VKuo0vY8aNs=; b=S6ysOJzYlgis6XxVKvRv4t1MeDzhKChcJr7p5U20N32F/b7yHZ7R/I6T08N9+gpJud KQiPdg1pgU9z7hbOY8ZFE2r0gvmxfYGz2RE7dwYVpLxaOs7zHgtfMEFhV+qLmrmk3xsx 8Q1/229F/dh5olTCKz4xfF9zPwMdtVSNVp8sxo2qAgorHpUGgoSSKzCwlRgP7/tFz7p/ J74tTFLT8MrIKfvgW1P4WgaG/a3nXtjsKIC8FoMqZW1dESWbPtn9Z3rgCjKZP4KH7hev vBrt5FTx553jm7nm516E0m6DOZl8Zd3TrXM6+tC6OutSMHZwuX54rm6sLXssYKgPMbOk cFNw== X-Gm-Message-State: AOAM532Q8gcGMGVqZuxMRZSggoHOg31XkNw2co8SnB7yxxzGQJBVDVhW 0SV//C0l9/n7bhzkKEjxISY= X-Received: by 2002:a17:90a:de8d:: with SMTP id n13mr17681375pjv.95.1594622548490; Sun, 12 Jul 2020 23:42:28 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id l134sm12448695pga.50.2020.07.12.23.42.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jul 2020 23:42:28 -0700 (PDT) From: js1304@gmail.com X-Google-Original-From: iamjoonsoo.kim@lge.com To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Michal Hocko , Joonsoo Kim Subject: [PATCH v5 4/9] mm/migrate: clear __GFP_RECLAIM to make the migration callback consistent with regular THP allocations Date: Mon, 13 Jul 2020 15:41:52 +0900 Message-Id: <1594622517-20681-5-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594622517-20681-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1594622517-20681-1-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 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 --- 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 + * consistent with regular THP allocations. + */ + gfp_mask &= ~__GFP_RECLAIM; gfp_mask |= GFP_TRANSHUGE; order = HPAGE_PMD_ORDER; } -- 2.7.4