Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp962773ybt; Tue, 7 Jul 2020 04:41:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/I/s3iF2u/NgTbedps5QWf1O76A7REx11FuRKa5O/6F9B4xx38+gk9VkJD1ABQdAPALEq X-Received: by 2002:a17:906:2988:: with SMTP id x8mr39867047eje.141.1594122076435; Tue, 07 Jul 2020 04:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594122076; cv=none; d=google.com; s=arc-20160816; b=zDnGBR382zUDRQjZci9CfhE1+xSmgpP34awYx+qnifz3jRqNBibpFa805B22XPPiWp HCzO83GdSu6qSAezdY0NetZRNbmA/uDQkQtrG2ZOAr9IWAxdPycbzlPjBmHSo9zJH9Zn HCX+HAO0HXBhNR87JsWKVYifz/oXyMIrJvcfxhS4zso2j19kgEMwLZhjq699DV2la+zt 5uJUG9BzTwqUusafSZW0pdlNLs6lMNZXuXqb1GFePo8R9UNPeuZq46xmIWFE1IT3iOq7 YQ+CSR1cum1vXbQzGkJq1ZYMppUBI66YjpttUpqyqNCo2qMq8l17pL8Ml1Cm/nH5QHqZ imYw== 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=TYzmEtg/Kj0i964ThN6Qo6tqP9/EQZBPoedHzLNj/F8=; b=QjyhpSDq+0mltVQlqzMCBfyXQSpPE+JPnKjov5WFPT3LzsdKlEeyE8CJwlu/NO3hxh 075Nn71WEA1wSTbVUvlkOTaM95XlEi+brK1yboeaYMJsDqbzWn/kSWWUd4Wh7oSEBoDn WiHMiEwCNVRfS3HjHLcAwCATlom+aGLWKfoLS+X5on1U3UwWm7TxJYFYKBhE8Ka5S777 Spz2uoqZ4MYqo/VElU5j/k9zzmeybcV8hEqBNXeqIeuyPtySpY1k7bN61UtPb1HEP9JX /BJ1M0YZrGfuuyAhBQlNuro+YtofsU5af5K+8CzdTfjnUr6Ad5XwB6qI5WaXCqBLnHUo P5jw== 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 ca5si14757842edb.511.2020.07.07.04.40.53; Tue, 07 Jul 2020 04:41: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; 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 S1728294AbgGGLkZ (ORCPT + 99 others); Tue, 7 Jul 2020 07:40:25 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39437 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbgGGLkX (ORCPT ); Tue, 7 Jul 2020 07:40:23 -0400 Received: by mail-wr1-f65.google.com with SMTP id q5so44762215wru.6 for ; Tue, 07 Jul 2020 04:40:21 -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=TYzmEtg/Kj0i964ThN6Qo6tqP9/EQZBPoedHzLNj/F8=; b=GJC9OL0+i9DWAo9bwdhhGi/e+ozTBfQUBo7HrNeg84olo4fj2YN5F0orLV1azTlJdq mpTygsJXI18tUeENhZFm1LmDZW5No7mAgqXZ91m3KHVkxsF095bP2vyA0/jLNQBQRDzH IYJtVJ+LAlRFY6XiJ2LE8grRzIktLfD4vr1ft1Gi4Gz5QcviRYfk7ZKLOK/6J9rv7BRM c1DZ7+vT3YpKy+spRQb8hxKg9JUlqrzTmWgxi0eeIyyyz3S1obk7FTfaZGybjJWcp1tf LyZ/caQAg3MDvJ3Cbqg1aKw9OFtRcdsFAOusAHK6XAxCnNLiXaAbIw2M3ojaKph+7ti4 B2jA== X-Gm-Message-State: AOAM53330ZCLZ8TGdN3ojMz1gve1yNKowAZbMGBqQ4KpaxglyVl2z0sd Xb0aewRoDAZ9TrBeWFCIGTw= X-Received: by 2002:a5d:650e:: with SMTP id x14mr56294076wru.187.1594122021224; Tue, 07 Jul 2020 04:40:21 -0700 (PDT) Received: from localhost (ip-37-188-179-51.eurotel.cz. [37.188.179.51]) by smtp.gmail.com with ESMTPSA id o9sm650992wrs.1.2020.07.07.04.40.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 04:40:20 -0700 (PDT) Date: Tue, 7 Jul 2020 13:40:19 +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 v4 05/11] mm/migrate: clear __GFP_RECLAIM for THP allocation for migration Message-ID: <20200707114019.GI5913@dhcp22.suse.cz> References: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> <1594107889-32228-6-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594107889-32228-6-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 On Tue 07-07-20 16:44:43, Joonsoo Kim wrote: > 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). GFP_TRANSHUGE* is not a carved in stone design. Their primary reason to exist is to control how hard to try for different allocation paths/configurations because their latency expectations might be largerly different. It is mostly the #PF path which aims to be as lightweight as possible I believe nobody simply considered migration to be very significant to even care. And I am still not sure it matters but I would tend to agree that a consistency here is probably a very minor plus. Your changelog is slightly misleading in that regard because it suggests that this is a real problem while it doesn't present any actual data. It would be really nice to make the effective change really stand out. We are only talking about __GFP_RECLAIM_KSWAPD here. So the only difference is that the migration won't wake up kswapd now. All that being said the changelog should be probably more explicit about the fact that this is solely done for consistency and be honest that the runtime effect is not really clear. This would help people reading it in future. -- Michal Hocko SUSE Labs