Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp820532ybt; Tue, 7 Jul 2020 00:46:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO7aQ0IWBqQDxiu0NEvGsqPT1bE6E0G1BtEPkeIz16ePr0xNh/oSERNyXHPYD+5ZNKmfhT X-Received: by 2002:aa7:c4d8:: with SMTP id p24mr56215190edr.323.1594107976130; Tue, 07 Jul 2020 00:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594107976; cv=none; d=google.com; s=arc-20160816; b=pvPa3nEJXDkxxoDMxiT8Krf9lRaO2f9UHDVMhbbFs7u4IxIm2uBaKoyRwoVe3yq3B9 6whn0RvYbaNuCjxC0ZsTquxYFMwC0uPNfrDgJMJdnBvhFZT9Oq6Bx/is//GorxxuQf7u W42Yz5VRhvtQeH901jXKqZaQlzL5vaAp9r9Ph64pIVcPmsIaVQJXIP0eOgIUqd77Csp2 amkAVDKjoy+ht+Z6HBTrlc0wD6TZNWv7mTqCBeuCQ18HhAUwyuqNlDhzSj1d5/IK28gV SlXpcFOmXwXemYfP8bodkivsBpszEXQkuX0ImwK9WeRTdjoBEUh3JqgXs9fNHZJWkK9Y OX4w== 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=ktEVs8Hqf991Zw2ArJoEaKXQpHVgkoYtcCgWjEGUnPA=; b=MOgNSuLYUazi5D7Q4W6i9275NWuJsbW7A5lCU7jEaVP2IUZmeoTXcStlNfVWdRquX5 ifzO8W4nf67BLlsxltRiry3KpFCrTTty2AkmGT2sQwi1DvYv9XEg8sZUmhyKfeDlZ8bK sx1Oyxl76m3ms5BFk0dgXWTAizzUYkv2fyUJ3K2GPnaqfVPDQ20vRvZ0ZRBy4B4Ua3oq OOijFidue097nc3dIkPatoUyM8wG2fCqs3OqZZqVSCZwbRRbjbPwPF/yyRQPRIrHOkYP i98VH2kAODjzOw2ZvIJvD8cisrrDX+IaWauR8N3lJO9s5f9wjFpcT0/AvY4HWL6f9Eab KJsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bCudhXV2; 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 pw19si14251855ejb.752.2020.07.07.00.45.52; Tue, 07 Jul 2020 00:46:16 -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=bCudhXV2; 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 S1728357AbgGGHp2 (ORCPT + 99 others); Tue, 7 Jul 2020 03:45:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728300AbgGGHp1 (ORCPT ); Tue, 7 Jul 2020 03:45:27 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 260F3C061755 for ; Tue, 7 Jul 2020 00:45:27 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id w2so18815932pgg.10 for ; Tue, 07 Jul 2020 00:45:27 -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=ktEVs8Hqf991Zw2ArJoEaKXQpHVgkoYtcCgWjEGUnPA=; b=bCudhXV2TzMRpdKEib0op4Bt1pN4XyWefDsWoE0tYUAf4gkc81psR8GAUTwgJJRAJv thHfe6n8q2aCG+nNXI2nzD7uRDNnN/OA8SOvjSeQj+iL94vLPSZk4ONTQTFMzp+k1biU /t3G2ZqdZhhE3VAKwLBBGhv7YRqJMdDo7UOKJQVBDYUoCW4YvjpDsovPbpcAa8hFUuC3 /0Z6/m68F6DqhNf5tZuJ6GIuFeqg9lFHLMTnxVGqJl4dVRhoID6u34VcGT/ZzlB8fFsa Vpz9G0PMMSH7a7enbL0XdW14UF28HegZGy7SYA0A5hJS9VizcDYiNGvaM0gBHN+FMDZA aiBA== 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=ktEVs8Hqf991Zw2ArJoEaKXQpHVgkoYtcCgWjEGUnPA=; b=Lb+Su1Dbk+cUKHYxS3knwhHgAIMMNqE/LJYjviz6Kx7VMLRw4jL7X2Fvh+Z5Fqp/fX hIaD5jOtHnR8uq1nG4b8HPqz2QnbTnFhhtubKO2LfpIw8O18vfH+af/PtenPGvDGAdmN NWVTx15g5Uteo/GS7RPoox97tOj0vtW1VqyVMmMm/E8G2vPxa9tmvj4ics3JM01dmelK TR8JUoEQCkZaMtZSEcj8dFRedz4ilUAfqZKx8tiq5ZH9qu33k1hRcMrHLaPZzqKK/2Gn ovBuRaWZcNjekjPE8rJrfIxZsc6g7XoRG3xRNs0JR14O6Bj7GNiN5TWDoR7doEmT+YIQ vh4g== X-Gm-Message-State: AOAM531PoXx7NujgYgrFFjV4ssoceNCq+ezefHpOhM/DV5yvIbNbu9Sp DPCrVxYBfcZk1G1dlOdYcSQ= X-Received: by 2002:a65:6150:: with SMTP id o16mr28727781pgv.237.1594107926731; Tue, 07 Jul 2020 00:45:26 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id 191sm21330151pfw.150.2020.07.07.00.45.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2020 00:45:26 -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 v4 05/11] mm/migrate: clear __GFP_RECLAIM for THP allocation for migration Date: Tue, 7 Jul 2020 16:44:43 +0900 Message-Id: <1594107889-32228-6-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1594107889-32228-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 In mm/migrate.c, THP allocation for migration is called with the provided gfp_mask | GFP_TRANSHUGE. This gfp_mask contains __GFP_RECLAIM and it would be conflict with the intention of the GFP_TRANSHUGE. GFP_TRANSHUGE/GFP_TRANSHUGE_LIGHT is introduced to control the reclaim behaviour by well defined manner since overhead of THP allocation is quite large and the whole system could suffer from it. So, they deals with __GFP_RECLAIM mask deliberately. If gfp_mask contains __GFP_RECLAIM and uses gfp_mask | GFP_TRANSHUGE(_LIGHT) for THP allocation, it means that it breaks the purpose of the GFP_TRANSHUGE(_LIGHT). This patch fixes this situation by clearing __GFP_RECLAIM in provided gfp_mask. Note that there are some other THP allocations for migration and they just uses GFP_TRANSHUGE(_LIGHT) directly. This patch would make all THP allocation for migration consistent. 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 02b31fe..ecd7615 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 since GFP_TRANSHUGE is the gfp_mask + * that chooses the reclaim masks deliberately. + */ + gfp_mask &= ~__GFP_RECLAIM; gfp_mask |= GFP_TRANSHUGE; order = HPAGE_PMD_ORDER; } -- 2.7.4