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=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0EAD5C433E0 for ; Fri, 3 Jul 2020 00:55:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C56F92073E for ; Fri, 3 Jul 2020 00:55:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bnD/q/x5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C56F92073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 751FC8D0002; Thu, 2 Jul 2020 20:55:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 702DE8D0021; Thu, 2 Jul 2020 20:55:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6214A8D0002; Thu, 2 Jul 2020 20:55:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 4B4EE8D0002 for ; Thu, 2 Jul 2020 20:55:45 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 08E20181AC9CB for ; Fri, 3 Jul 2020 00:55:45 +0000 (UTC) X-FDA: 76994947050.20.pan10_060e73426e8d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id D8B82180C07AF for ; Fri, 3 Jul 2020 00:55:44 +0000 (UTC) X-HE-Tag: pan10_060e73426e8d X-Filterd-Recvd-Size: 5504 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 00:55:44 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id j80so27497711qke.0 for ; Thu, 02 Jul 2020 17:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=R14iB3HyxYLduKlG30SljyVyNrxsxoGgt0DcZz0ltyM=; b=bnD/q/x53LVZJ/xSMYP8vb81Ov2apN4dLC7hNDSSSxVJtpH+fiIgZ254xxZhU6MWyj BaaZCw4cL4EDwAFLaEatFAEfGutlmkD1fQpmnZXlngPugTXLX39nuj2B4uwJJPWeHFdU 8DiXLHrbfFEI66uNAU3lZfizvphLteL7SE2l4sXzOXmhe0oYiC90CiohXQXQbUgAJHv9 jmVy7ut2qxw7UEASFUsu99p8E1z0WScKTA8+7GDzAieM4I7F56DZHIesn45b2bA6eTtQ ZShndqIXZapd+sOthbBLqYJLiAlkgZSz41Z2n5y6SoVZpcyGLtnHHVlgccCT79Zrk32U j55g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=R14iB3HyxYLduKlG30SljyVyNrxsxoGgt0DcZz0ltyM=; b=AO4to1N4sEEaj5E2X4DoDsQLrzqEVG9rC84+pIUYPCiJNgGU6BVpNEhdsL7tDmcezv m/S/NJBLKyCAd2touSQu8n7ucklUUqQ/evAYIlpE9Vy9WA//pzPGK+H21IRL2Vn+nYx/ 6RPS2FTGhDdQ64yyRjIQtdqbJ6eUVyJM0AmrVYky3cReSRwLtsrFot3+34kHun2oxYHg H+DCSO9fFVQ9spvXpcBK5tAXN3YYy4e48iNKVN/AqJkizhDapOoFD7vqzOKnY0zPJUr4 gJ9yZaue2bkeLBNOJ87Vr6HpSQc/UDQa2ebEgmUAlpKZQ8HVAwc+YGyl1dSWPT5Y3Jx/ Jk3A== X-Gm-Message-State: AOAM531qa8XeR11e0uQhaPNhcbkCXCUD6aaqQuXud8lhCeLHXZQoRq1C imLsa9u6kQPI3PxVQtMcBAWV/SV4uhls5DD4dUk= X-Google-Smtp-Source: ABdhPJxtn+eHCXYI2Y4J2s7umPGdlIBIgPLDIFVwggpDIFafCiKmGmXePo69C9JIjtMdVffJ7rlZ5R7gibtaFqAUnic= X-Received: by 2002:a05:620a:a1b:: with SMTP id i27mr33128417qka.429.1593737743909; Thu, 02 Jul 2020 17:55:43 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Joonsoo Kim Date: Fri, 3 Jul 2020 09:55:33 +0900 Message-ID: Subject: Re: [PATCH v3 3/8] mm/hugetlb: unify migration callbacks To: Vlastimil Babka Cc: Michal Hocko , Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D8B82180C07AF X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 2020=EB=85=84 7=EC=9B=94 3=EC=9D=BC (=EA=B8=88) =EC=98=A4=EC=A0=84 1:13, Vl= astimil Babka =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > 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. > > > > 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). Okay. Will check it. Thanks.