Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp337624ybt; Wed, 8 Jul 2020 00:57:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwhVWUUq34K7Yw2Y2lrj7dcAhnWjq6OQyPVjwxtp2uukDRtAkYQqB5LVr6EMp180OnquJG X-Received: by 2002:a17:906:841:: with SMTP id f1mr17208615ejd.229.1594195079707; Wed, 08 Jul 2020 00:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594195079; cv=none; d=google.com; s=arc-20160816; b=Xwokdd14Ep3+NsV1VpTm7mo/aEGAKkhpU3ZRmyNBZGXz13qoHaKpwgfX8ys25gehUm oN+dVji9yIotxmfG9+vPrsHJhoj5QNKnEIFf61aVEK9Oh8SGdRQodKmcsX2LbV2KgMp+ +pITjheKddC7hozjzYkeM1ZenD8rHVBEoDGWZc2yyMuaURUa1CRX3UmJt6FIQcAfBHw+ AmaJB1igVTzwh8MM2JZhxpGHjMXPJQ8ejTE9YuiFC0kGGVzFPSnvKOSsASpKWUg3g8hz pqVWIM0i0hTfuVWdCzuaesOPbaLNMyBPG8s5txcgaN0QAbZF2egbsZLOC66U+0MNcvCT VbSQ== 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=zry+YVLnJazpbmt6mpkdVvSYbOfVb62kd++eIeoVHS4=; b=0T/hi5HVKSMZF8mhgUux3o/NNC17xKzeQ3B0fZFY77uHCR5C5Rca+ZZrLnKBa1EZSP YzFJD9s/J5gEDcYFeFZ1UKApNVW0H7Z90rtHAVsPtVGopmJYiMkgblDl+VDlV1bFTrDA PAz0V8X6rsFvAYFEiDemT3Bj5TFg/BagmJBTliYLO/CRUNlMBWMxFLSa+wSlJgHcA06T bpPA6Qd3Ar0jmnEn1urtwG8aAKmnMZzBNSHnlA1oNMRJxckT23emrd1TMbmogAa6nb6y cdgrgBDA7YDCs0XdzAAKya7gA8NwC9Zgz9g4dCjBRRxhILly1whQy2kOIGJkMmAIhMi3 eLqA== 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 b23si16850968ejb.465.2020.07.08.00.57.36; Wed, 08 Jul 2020 00:57:59 -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 S1727104AbgGHHsZ (ORCPT + 99 others); Wed, 8 Jul 2020 03:48:25 -0400 Received: from mail-ej1-f67.google.com ([209.85.218.67]:46751 "EHLO mail-ej1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgGHHsY (ORCPT ); Wed, 8 Jul 2020 03:48:24 -0400 Received: by mail-ej1-f67.google.com with SMTP id p20so49283030ejd.13 for ; Wed, 08 Jul 2020 00:48:23 -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=zry+YVLnJazpbmt6mpkdVvSYbOfVb62kd++eIeoVHS4=; b=KSWJHQAWf7P8efzd0BL1J69PcoH2K/QJN8WFjmC8sehRc29WzSHtPF3A1s9Irw4b3x kxAwuoE8DoiLLt6kwv7w3zicO0ccuxrtOI/PBw3MiM5oqWEEQnPzz/d4pN2/NqhbWrkm OVlechoud+ITq8NHsOefEm3os4feixx04++7a5ovjfTGB6uyAsfoscN0WkiVcDE0+4gX hUhAGMpugxfL3w5vHHYT/8ptQPpO6lnRte9s/HAg/OZGL5pRBUK/BIRH1CTqAdaohFL6 qwXoPms25GegFmOozp4/mAIoJEHcoGpPVSd1WkUvMlsg4weQ6WR/siKm8ggMBj7CwTn+ y5uQ== X-Gm-Message-State: AOAM5337Hji15SnpIk7nl5SKdRqP3QblatDT2UswUr9f9Mjr67r5RW8V o/fJNDqY0ggxgTo9jWLTz5Q= X-Received: by 2002:a17:906:d143:: with SMTP id br3mr48735485ejb.268.1594194502861; Wed, 08 Jul 2020 00:48:22 -0700 (PDT) Received: from localhost (ip-37-188-179-51.eurotel.cz. [37.188.179.51]) by smtp.gmail.com with ESMTPSA id ay27sm27136473edb.81.2020.07.08.00.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 00:48:21 -0700 (PDT) Date: Wed, 8 Jul 2020 09:48:20 +0200 From: Michal Hocko To: Joonsoo Kim 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 Subject: Re: [PATCH v4 05/11] mm/migrate: clear __GFP_RECLAIM for THP allocation for migration Message-ID: <20200708074820.GE7271@dhcp22.suse.cz> References: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> <1594107889-32228-6-git-send-email-iamjoonsoo.kim@lge.com> <20200707114019.GI5913@dhcp22.suse.cz> <20200708071916.GD16543@js1304-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200708071916.GD16543@js1304-desktop> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 08-07-20 16:19:17, Joonsoo Kim wrote: > On Tue, Jul 07, 2020 at 01:40:19PM +0200, Michal Hocko wrote: [...] > Subject: [PATCH] mm/migrate: clear __GFP_RECLAIM for THP allocation for > migration > > In migration target allocation functions, THP allocations uses different > gfp_mask, especially, in regard to the reclaim gfp_mask. There is no > reason to use different reclaim gfp_mask for each cases and it is > an obstacle to make a common function in order to clean-up migration > target allocation functions. This patch fixes this situation by using > common reclaim gfp_mask for THP allocation. I would find the following more understandable, feel free to reuse parts that you like: " 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. " -- Michal Hocko SUSE Labs