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.0 required=3.0 tests=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 C1EECC433DF for ; Fri, 26 Jun 2020 07:23:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 914192076E for ; Fri, 26 Jun 2020 07:23:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 914192076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2E7BC6B0007; Fri, 26 Jun 2020 03:23:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 296806B0008; Fri, 26 Jun 2020 03:23:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AC636B000A; Fri, 26 Jun 2020 03:23:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id F3B386B0007 for ; Fri, 26 Jun 2020 03:23:28 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B8C0E180AD817 for ; Fri, 26 Jun 2020 07:23:28 +0000 (UTC) X-FDA: 76970522496.15.coat56_190afce26e53 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 867711814B0C1 for ; Fri, 26 Jun 2020 07:23:28 +0000 (UTC) X-HE-Tag: coat56_190afce26e53 X-Filterd-Recvd-Size: 4687 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Fri, 26 Jun 2020 07:23:28 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id h28so6161729edz.0 for ; Fri, 26 Jun 2020 00:23:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=QEbKXP8FUgYuXuT6takZ5c8rrVZ/DcOt9hyzMr4EANc=; b=g93zrt0lFlbfqVntPgVJnSbz0mLuMgxbJRjKkMA5bVClNypDU23eO4rMntyucXHo+A dR5SNV9ZgJUEtF96lfUzhQSgkwJmnSHM7OIMoxKLYKu9vKDy9wCaQQ9KHf8EfSd6K81+ OujFzOS0iw8kMJb0EzU3q/D+9nWsmMPHcKIcSasH2yJBTsp/zU7m/IP5UzpJDQh/dxDM Y7ksdjBr3NgBIvztyJE5Xe6hSR0jMT/HkRg2l8yKZQOGiBCXIJFVSVfh2b519wZK8K8F iqVCsBDZDeNTJ3Nzzuv2lv2wzP/9BO9u8M/CjXBIbh62AXBSgTEO4YrWQaWhSKYBNG+d ID1A== X-Gm-Message-State: AOAM530yOEOeuW64Ucu/HwbCPjyhHMFPepEVBMvTgyhoBb78w7jpdeQ/ MlBsON9eqLtlxSrVwqtTIGo= X-Google-Smtp-Source: ABdhPJwVwkw4iKVEaU0es39MMKnKwPM9vSwQC0Z4BjvkXK/ajy/GR7r3yl+tcX7xw9YuzXumF7gmMQ== X-Received: by 2002:a50:e8c8:: with SMTP id l8mr2050076edn.386.1593156207272; Fri, 26 Jun 2020 00:23:27 -0700 (PDT) Received: from localhost (ip-37-188-168-3.eurotel.cz. [37.188.168.3]) by smtp.gmail.com with ESMTPSA id a2sm8817292ejg.76.2020.06.26.00.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 00:23:26 -0700 (PDT) Date: Fri, 26 Jun 2020 09:23:24 +0200 From: Michal Hocko To: Joonsoo Kim Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Joonsoo Kim Subject: Re: [PATCH v3 4/8] mm/hugetlb: make hugetlb migration callback CMA aware Message-ID: <20200626072324.GT1320@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 867711814B0C1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 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? >=20 > If we remove __GFP_MOVABLE when calling alloc_huge_page_nodemask, we ca= nnot > use the page in ZONE_MOVABLE on dequeing. >=20 > __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). >=20 > 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. --=20 Michal Hocko SUSE Labs