Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1604015ybt; Thu, 2 Jul 2020 09:15:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsEVhWOaeZOymQy3G26W6zsn/5II5XPQRl5avmgIeaE/yUb7NIedP7VWRyAeYYy50C2O8J X-Received: by 2002:a50:a207:: with SMTP id 7mr36436405edl.92.1593706549987; Thu, 02 Jul 2020 09:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593706549; cv=none; d=google.com; s=arc-20160816; b=BKB+ElLKoYvt9f+wV9bPjnn06mkrvid7q34THick31PAR90tdPnqUaOnmAF6zYJByd t5rZFmyBSUikGmV1RleQLFUgcs64hAIuEZIZhure5ufpcaYHwCGiyR46bNtUuJP/06lk jq5KjOoRJUfk2go+FMKpgJDVtkZyvxxDcML5WbVgD7SKSWzp7SD4GFIOdYxi9rTxieTS CeNlkJOVFAfP5jWBmUHf0iu8aWeUYqApLcxkTGJzZtFATOplI2TIwa1i1i2qegGD+DmY 5DhRInuULLa/36eVeUBd68JtvMqixpl9u/CfFpbYvHelNbd+TnlWZyXv6GLURt7a8PlQ i+zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=z//CXaq8tcSr063c7KDFEtMA7IHI62KBYq+tDeuT6hM=; b=ws0F/9fYUYX6yiSBSIA+f5AYmME2XDIRKFfuEIwCldqjG9XHlOukCkVRm5lfFECnHp KX7upGKzPOccd3JzA7+UeDwCIIA6QxC71oPEda/SOlzlsA5KoYgjSZVeqA1kC7pqh2r6 Flb+LDy7Q8bTOog4GIrm0sI6Qjv3AVkxfW3rxCpIRo8jsLydUhziC175yzynqFIT8SBP 2TKtLFN9HgM9iOoIynRwr1L+sDCIGhLu760wUAMDh0m2KUnTTRfTF9z3nD1GCfAjiXd7 awu4iCdwmnOWuWSBJS+8CtgcDEpmCwyA1VIf4T0GI8e543VV2orgDJpnXc65uXuh/I3P xhXw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si6346399ejx.722.2020.07.02.09.15.26; Thu, 02 Jul 2020 09:15:49 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726290AbgGBQNM (ORCPT + 99 others); Thu, 2 Jul 2020 12:13:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:58640 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbgGBQNM (ORCPT ); Thu, 2 Jul 2020 12:13:12 -0400 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 987DCC11D; Thu, 2 Jul 2020 16:13:10 +0000 (UTC) Subject: Re: [PATCH v3 3/8] mm/hugetlb: unify migration callbacks To: Joonsoo Kim , Michal Hocko Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Joonsoo Kim References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-4-git-send-email-iamjoonsoo.kim@lge.com> <20200625112625.GD1320@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: Date: Thu, 2 Jul 2020 18:13:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/26/20 6:02 AM, Joonsoo Kim wrote: > 2020년 6월 25일 (목) 오후 8:26, Michal Hocko 님이 작성: >> >> On Tue 23-06-20 15:13:43, Joonsoo Kim wrote: >> > From: Joonsoo Kim >> > >> > There is no difference between two migration callback functions, >> > alloc_huge_page_node() and alloc_huge_page_nodemask(), except >> > __GFP_THISNODE handling. This patch adds an argument, gfp_mask, on >> > alloc_huge_page_nodemask() and replace the callsite for >> > alloc_huge_page_node() with the call to >> > alloc_huge_page_nodemask(..., __GFP_THISNODE). >> > >> > It's safe to remove a node id check in alloc_huge_page_node() since >> > there is no caller passing NUMA_NO_NODE as a node id. >> >> Yes this is indeed safe. alloc_huge_page_node used to be called from >> other internal hugetlb allocation layer and that allowed NUMA_NO_NODE as >> well. Now it is called only from the mempolicy migration callback and >> that always specifies a node and want to stick with that node. >> >> But I have to say I really dislike the gfp semantic because it is >> different from any other allocation function I can think of. It >> specifies what to be added rather than what should be used. >> >> Removing the function is ok but please use the full gfp mask instead >> or if that is impractical for some reason (wich shouldn't be the case >> as htlb_alloc_mask should be trivial to make static inline) make it >> explicit that this is not a gfp_mask but a gfp modifier and explicitly >> state which modifiers are allowed. > > Okay. I will try to solve your concern. Concrete solution is not yet prepared > but perhaps I will use full gfp_mask by using htlb_alloc_mask() in caller sites. Yeah, that should be feasible. alloc_huge_page_vma() already does htlb_alloc_mask(h). In alloc_new_node_page() and new_page_nodemask() it would be consistent with the other cases handled there (THP and base). > Thanks. >