Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1182113ybt; Thu, 9 Jul 2020 00:17:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+ANxbxolFAB+yf965mIgBgueI7wal3YazuRhM9K6NpxPX5DOMOIrmW5JWa6OzsUNwsbJp X-Received: by 2002:aa7:da46:: with SMTP id w6mr61221219eds.261.1594279070518; Thu, 09 Jul 2020 00:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594279070; cv=none; d=google.com; s=arc-20160816; b=09sNE+MihqAYbcE7/2T2K68CSHNbLnTTIWrKy8werWSpePDQaW3N3tKPEiTo68mxEy Zx0INouTXU3ivTA8/pF3dNlkxdO+5DdqYEb4S+kAYShSOODJ0H89nN+SxKVplwNICLqI bpNjeVay3lxgQQHz28EkPkKPwjEpF7lvRlAn94WwB4Mmq2UJ9n5xzBP8oKl7xobn2geS U4eJu4Bk7X4RvIjL6XZoaIXBrlAxvKzdYLnQYLkKSWCI6SQSY6swqkjW3AAp2XpW2am5 wLBNMe1PRw+itF8GwAJhvHNQ4Ov68c6m49ARBuIH6OVbZSTkNeDRjiBeyjaW9SjTZYkp CZlA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7vcRUcabRzePkZOGRbYrDqFkKibNGxlJw3maVMmHDKo=; b=mdtcZID8XIhT5XKa3WDAEffDKqu2hRvpTK89ixNj8PjF2hf5ZaHTiq66vIZ0uchWzu BponmGKIzn4EmdkjTf0ptwI7zDvF/bO5gWI9r6tfl2EcqU4GTVx5oRC55dy9HQELxj7n mBsSJW8Gc87AgW1OteSN8emk4eBPWwadxqejs3RmnvBLI9yQ0HXZ+TdnlfxB8hLfzAsC 2pn+mwwNaPPvzeJVoEB/tzX49VyvxSgDYiK7YJmZgl7vMOUp8PPa7rSLyKRjPMjDBbmM 87hIkvHDJ0T9I+EnJdH4RcNit8YTBYVpJicR2oNZrXLXot8vIsSiYDdBEC8rbr5RwCe4 7zDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Q2alEo/X"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si1620916edn.594.2020.07.09.00.17.27; Thu, 09 Jul 2020 00:17:50 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Q2alEo/X"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726306AbgGIHPJ (ORCPT + 99 others); Thu, 9 Jul 2020 03:15:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbgGIHPJ (ORCPT ); Thu, 9 Jul 2020 03:15:09 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAA0FC061A0B for ; Thu, 9 Jul 2020 00:15:08 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id c139so850553qkg.12 for ; Thu, 09 Jul 2020 00:15:08 -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=7vcRUcabRzePkZOGRbYrDqFkKibNGxlJw3maVMmHDKo=; b=Q2alEo/X/bR3uA+F7PQQg1jWRqZg4tt0kJ8vDP5M6453eKBqxBxIZydwCd0uqZN+je 3zxMsQfw8gN26sMy/Umrf8Fdz02pMJjEJw0yavbJsUCJYJJDW3oPHTReJslUKQIx0bdr BfRfcfxb/JNUd8Or/REbGyT6zWe4QOvDJYuZ0cxqxaKJWAsi4V3akY6JfcC6uENd1A03 c5dqflme6vijOs4XN0ZHEGCHQ3yZSlk22Yj8VdK5eg1Pn8JQpQIrv9EJEljOTFRA6vZJ WTQDSMByTQv8LYrz1ertuRt5f1JH0Yu2CuBYU8a46wJFlIRzLbwdELNqUQc3Cy2FqFAh +RgA== 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=7vcRUcabRzePkZOGRbYrDqFkKibNGxlJw3maVMmHDKo=; b=fmT2Ywu0klAuClLhZmpKOWAAR2fd8oQ1HJHP+Acg9Y/Pf9hvgFBUPLjEq9EJEwkQts Y412kJK6eDaMZz7kSMSLtkHfFthP/dCHmKvB/AZOOpELa/owS1gpmFfV61ZHaohZcDvi Cy4IZj2VKhIO0rhm0yLmrsDSi/SXn4x9Eb30gmVF7bK/Wk/WOaTse0g3v6Vgk8VA3mHw Va3tk05XrTNIgnsvm7UvQWQ+uAdsDdOwsd3zxs5eugt+dyuPFmWQS8CV93ZrENFj1pbx IfYatLvAwdvfr/HhD3FAvF5nPkX5ZCIZYPI53S6azpKpLANOy0oN8r9vl5eciRZrAqiM iH7w== X-Gm-Message-State: AOAM533xhc6yuWkfAn8xqutRhbRwTc8nQFFfbVm+hJWF8LtCw8u3stnE AHnH0vkA5MS73sm+6LCwDHssu81LC/42uOZM5vA= X-Received: by 2002:a37:6d2:: with SMTP id 201mr35687344qkg.187.1594278907930; Thu, 09 Jul 2020 00:15:07 -0700 (PDT) MIME-Version: 1.0 References: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> <1594107889-32228-7-git-send-email-iamjoonsoo.kim@lge.com> <409b6e24-d143-a61c-95a3-1a55e1a6008e@suse.cz> <20200707190013.GZ5913@dhcp22.suse.cz> In-Reply-To: <20200707190013.GZ5913@dhcp22.suse.cz> From: Joonsoo Kim Date: Thu, 9 Jul 2020 16:15:07 +0900 Message-ID: Subject: Re: [PATCH v4 06/11] mm/migrate: make a standard migration target allocation function To: Michal Hocko Cc: Vlastimil Babka , 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2020=EB=85=84 7=EC=9B=94 8=EC=9D=BC (=EC=88=98) =EC=98=A4=EC=A0=84 4:00, Mi= chal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > On Tue 07-07-20 16:49:51, Vlastimil Babka wrote: > > On 7/7/20 9:44 AM, js1304@gmail.com wrote: > > > From: Joonsoo Kim > > > > > > There are some similar functions for migration target allocation. Si= nce > > > there is no fundamental difference, it's better to keep just one rath= er > > > than keeping all variants. This patch implements base migration targ= et > > > allocation function. In the following patches, variants will be conv= erted > > > to use this function. > > > > > > Changes should be mechanical but there are some differences. First, S= ome > > > callers' nodemask is assgined to NULL since NULL nodemask will be > > > considered as all available nodes, that is, &node_states[N_MEMORY]. > > > Second, for hugetlb page allocation, gfp_mask is ORed since a user co= uld > > > provide a gfp_mask from now on. > > > > I think that's wrong. See how htlb_alloc_mask() determines between > > GFP_HIGHUSER_MOVABLE and GFP_HIGHUSER, but then you OR it with __GFP_MO= VABLE so > > it's always GFP_HIGHUSER_MOVABLE. Indeed. > Right you are! Not that it would make any real difference because only > migrateable hugetlb pages will get __GFP_MOVABLE and so we shouldn't > really end up here for !movable pages in the first place (not sure about > soft offlining at this moment). But yeah it would be simply better to > override gfp mask for hugetlb which we have been doing anyway. Override gfp mask doesn't work since some users will call this function wit= h __GFP_THISNODE. I will use hugepage_movable_supported() here and clear __GFP_MOVABLE if needed. Thanks. Thanks.