From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB507C433E0 for ; Thu, 2 Jul 2020 16:13:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B8A6D20720 for ; Thu, 2 Jul 2020 16:13:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8A6D20720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 57D906B0098; Thu, 2 Jul 2020 12:13:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 52E356B00A8; Thu, 2 Jul 2020 12:13:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46BD38D0012; Thu, 2 Jul 2020 12:13:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 32CED6B0098 for ; Thu, 2 Jul 2020 12:13:30 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C91412DFD for ; Thu, 2 Jul 2020 16:13:29 +0000 (UTC) X-FDA: 76993630938.15.arch64_600bd8b26e8a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 787D31814B0D6 for ; Thu, 2 Jul 2020 16:13:12 +0000 (UTC) X-HE-Tag: arch64_600bd8b26e8a X-Filterd-Recvd-Size: 3535 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2020 16:13:11 +0000 (UTC) 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 X-Rspamd-Queue-Id: 787D31814B0D6 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 6/26/20 6:02 AM, Joonsoo Kim wrote: > 2020=EB=85=84 6=EC=9B=94 25=EC=9D=BC (=EB=AA=A9) =EC=98=A4=ED=9B=84 8:2= 6, Michal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: >> >> 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. >=20 > Okay. I will try to solve your concern. Concrete solution is not yet pr= epared > but perhaps I will use full gfp_mask by using htlb_alloc_mask() in call= er 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 w= ould be consistent with the other cases handled there (THP and base). > Thanks. >=20