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 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 5E840C433E0 for ; Mon, 29 Jun 2020 06:27:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E8C5F23134 for ; Mon, 29 Jun 2020 06:27:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="przNSppQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8C5F23134 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 386EC6B0003; Mon, 29 Jun 2020 02:27:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 337C46B0005; Mon, 29 Jun 2020 02:27:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 225FE6B0006; Mon, 29 Jun 2020 02:27:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 0AA4A6B0003 for ; Mon, 29 Jun 2020 02:27:57 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 78ECF2DFA for ; Mon, 29 Jun 2020 06:27:56 +0000 (UTC) X-FDA: 76981268952.19.cause18_551090c26e6d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 529731ACEA4 for ; Mon, 29 Jun 2020 06:27:56 +0000 (UTC) X-HE-Tag: cause18_551090c26e6d X-Filterd-Recvd-Size: 5737 Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Mon, 29 Jun 2020 06:27:55 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id i3so11998897qtq.13 for ; Sun, 28 Jun 2020 23:27:55 -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=Gw+tVMm108dlvFYjlgwkpaUNmll9hAXTiZNH1A33xQ0=; b=przNSppQECjARpTbHjJkQFKIlyZSg/yLk36HoqgLJfT6zaLv3Fsbt5tP8s6ae02+PB F4UPSvnIvJBNZOI2ib2Mdt2lK1E6HP2S+EkxJvGY3WHPL2Zg+/vVF884MUFyPQFfc7uI uSS5jWgEU7jmgZRvPvZPTlTFcCX11DE1oO+hb241K++4iccR7XtkUn2QCDqFdOzF/KAN NGCvNOIgKuFar6XPwvDKGq23IUPMDgZb2b3xDMhiFsHrrnogC5tbjTN58h1+LSUZXmaX M37IyMUORC+oewtY1OwU/rdIbcPBRQ5Cx2BJPCfWWEH8LbSmlGCfdIIhdhJgKJ1VyoB3 +Scw== 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=Gw+tVMm108dlvFYjlgwkpaUNmll9hAXTiZNH1A33xQ0=; b=osrVGlNXVpK6jbNkmaMK6Fi/Dl6OI3BVh8oUdowd8EgjRXEvr9ifd+icnNxUl3Urly 2KxS9fXzugaQs0xYk0MEA04+ILvmkTkC//FSzYh+4U1VifjaMphxFIZljjmcXr+vGK+I O/+BFS8WVJ2TToKtIyqBqLQrXnzJ0OjBi5FLge94IkMsfcHIgKElHkEJ0y1wy2cXBsUi sAFknmRiFdpUOKli2SZdJosYfzy4N8fVKsnOSobiIW+WCU8Buk+t8hLnG7B04tKfMlms X1NJbxbf0cotxMFc6K8mzU4/LguiL3ntZHCboPMOQv0P4MctZpSyGwXyF1YmpzvNZyTV 3C5Q== X-Gm-Message-State: AOAM530HbHcr3HdSW+D4XMq+S8Vjf1mY7O/B0fIdhna2JbL03EV8evfb NLT8QFBoZGhNYoa7EPnofB1a4OxO3s84iKMO9yU= X-Google-Smtp-Source: ABdhPJyVlrDmlqf0W/7e/BtgRL4HPLYLuwxx1jWb4SX2UH0c02g368/AG9vu6e4mYEKkj6K0x4vrVZ/5qPHQsX3LWks= X-Received: by 2002:ac8:4f49:: with SMTP id i9mr14322889qtw.65.1593412075217; Sun, 28 Jun 2020 23:27:55 -0700 (PDT) MIME-Version: 1.0 References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-5-git-send-email-iamjoonsoo.kim@lge.com> <20200625115422.GE1320@dhcp22.suse.cz> <20200626072324.GT1320@dhcp22.suse.cz> In-Reply-To: <20200626072324.GT1320@dhcp22.suse.cz> From: Joonsoo Kim Date: Mon, 29 Jun 2020 15:27:25 +0900 Message-ID: Subject: Re: [PATCH v3 4/8] mm/hugetlb: make hugetlb migration callback CMA aware 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: 529731ACEA4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 26=EC=9D=BC (=EA=B8=88) =EC=98=A4=ED=9B=84 4:23, M= ichal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > On Fri 26-06-20 13:49:15, 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:5= 4, Michal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > > > > > On Tue 23-06-20 15:13:44, Joonsoo Kim wrote: > > > > From: Joonsoo Kim > > > > > > > > new_non_cma_page() in gup.c which try to allocate migration target = page > > > > requires to allocate the new page that is not on the CMA area. > > > > new_non_cma_page() implements it by removing __GFP_MOVABLE flag. Th= is way > > > > works well for THP page or normal page but not for hugetlb page. > > > > > > Could you explain why? I mean why cannot you simply remove __GFP_MOVA= BLE > > > flag when calling alloc_huge_page_nodemask and check for it in dequeu= e > > > path? > > > > If we remove __GFP_MOVABLE when calling alloc_huge_page_nodemask, we ca= nnot > > use the page in ZONE_MOVABLE on dequeing. > > > > __GFP_MOVABLE is not only used for CMA selector but also used for zone > > selector. If we clear it, we cannot use the page in the ZONE_MOVABLE > > even if it's not CMA pages. For THP page or normal page allocation, > > there is no way to avoid this weakness without introducing another > > flag or argument. For me, introducing another flag or argument for > > these functions looks over-engineering so I don't change them and > > leave them as they are (removing __GFP_MOVABLE). > > > > But, for alloc_huge_page_nodemask(), introducing a new argument > > doesn't seem to be a problem since it is not a general function but > > just a migration target allocation function. > > I really do not see why hugetlb and only the dequeing part should be > special. This just leads to a confusion. From the code point of view it > makes perfect sense to opt out CMA regions for !__GFP_MOVABLE when > dequeing. So I would rather see a consistent behavior than a special > case deep in the hugetlb allocator layer. It seems that there is a misunderstanding. It's possible to opt out CMA reg= ions for !__GFP_MOVABLE when dequeing. It's reasonable. But, for !__GFP_MOVABLE, we don't search the hugetlb page on the ZONE_MOVABLE when dequeing since dequeing zone is limited by gfp_zone(gfp_mask). Solution that Introduces a = new argument doesn't cause this problem while avoiding CMA regions. Thanks.