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=-1.1 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, URIBL_BLOCKED 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 866CFC433E0 for ; Fri, 26 Jun 2020 04:02:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 286DF20767 for ; Fri, 26 Jun 2020 04:02:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EBYtwHmO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 286DF20767 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 7035E6B0003; Fri, 26 Jun 2020 00:02:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B36B6B0005; Fri, 26 Jun 2020 00:02:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F0CD6B0006; Fri, 26 Jun 2020 00:02:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id 4A1386B0003 for ; Fri, 26 Jun 2020 00:02:54 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A4C4E824556B for ; Fri, 26 Jun 2020 04:02:53 +0000 (UTC) X-FDA: 76970017026.16.spark17_090711d26e52 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 7F156100E6903 for ; Fri, 26 Jun 2020 04:02:53 +0000 (UTC) X-HE-Tag: spark17_090711d26e52 X-Filterd-Recvd-Size: 4829 Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Fri, 26 Jun 2020 04:02:53 +0000 (UTC) Received: by mail-qv1-f66.google.com with SMTP id dm12so3922854qvb.9 for ; Thu, 25 Jun 2020 21:02:53 -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=tZ10wzKAlun9ezjnRJ6vAT4r5GZ70Nwas5NbwCUvzuo=; b=EBYtwHmORFxtCoCvv7YQq+Qs5V4daAv5+kVh3p/R+NpJlM6vO9JhKGny298bG/WkTc EXD25rwUZd7ArQD/PK0WUbwXdB1Aaf8R+CjkI+X3LzsjilJrZ7K2pfH725FpvDbN8RY3 NWbH7Gbsh5aRDUGlNp7+iO6iQfCpIq+UBpQ1V4/x8at4cvHpYcBRHSsvQ/9qiIEAxSGn JRtp/iFsbb+YVA6PcrTkNLf/OHF9I2SEksiOpns8x5Bu+heDBLlqt6Yj4CkSDZjb72fx LBLOWc0NHD6rTcPRQSIlIuu/hkI7OxfittbAtcG5j+rV0ECIMdaiHGBNA8A20pEiPrp0 4ilA== 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=tZ10wzKAlun9ezjnRJ6vAT4r5GZ70Nwas5NbwCUvzuo=; b=rYYvP9jUy2i1iKZZ3AdkA0kDt1mHu0L6wv5XA9eWhnK8Zsn9409aqyizSq2qyiy2QZ qEQxZpm4nFCuWLq5BmjvEM/TX0PpuOTstrYTA/l8mbCu3I13cnQAn6WMe+Tf8x4BGk06 yB1Ei2XZGz4iIM+urLI+JTJaYWDruDBA4Us1+TfMbOnCMvR7ae10nSBWRQJCoUzB2N6r 8HLv7wvg/NNzO1BEFZor7oCHQSPciekaxO3hX8DrW3u3tuRlN4em1xaQs8TUuwH4B4dh 6JeKRZDEMlA4WCMYW6qRiWllgJGJdLiOMVo45GwjpTAWGAWN7Qnuki9DUrcC7RF8zT1O C+aA== X-Gm-Message-State: AOAM530n/Wj7s6bLIK70HPyD8L1+Qc5oHGSZJaJRROe48g+t8rtmfUCs Tj7HBoIC7efXrXw/R73FpbHhY5ivmX0Bt4z9qXU= X-Google-Smtp-Source: ABdhPJykweMvMY4T5KvPqNSo3+8We/c7WLmalDrZyaVbtMocvbX085rJvJtf7OhGXD5vI/iKmGXhSEWFHIYYiTmyyH8= X-Received: by 2002:a0c:b48e:: with SMTP id c14mr1358186qve.66.1593144172503; Thu, 25 Jun 2020 21:02:52 -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: <20200625112625.GD1320@dhcp22.suse.cz> From: Joonsoo Kim Date: Fri, 26 Jun 2020 13:02:41 +0900 Message-ID: Subject: Re: [PATCH v3 3/8] mm/hugetlb: unify migration callbacks To: Michal Hocko Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Vlastimil Babka , 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: 7F156100E6903 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: 2020=EB=85=84 6=EC=9B=94 25=EC=9D=BC (=EB=AA=A9) =EC=98=A4=ED=9B=84 8:26, M= ichal 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 prepar= ed but perhaps I will use full gfp_mask by using htlb_alloc_mask() in caller s= ites. Thanks.