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=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 9C220C433DF for ; Tue, 30 Jun 2020 07:22:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B5BE20759 for ; Tue, 30 Jun 2020 07:22:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gOzXbiGv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B5BE20759 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 DD83D6B008A; Tue, 30 Jun 2020 03:22:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D88F56B0096; Tue, 30 Jun 2020 03:22:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9E7E6B0098; Tue, 30 Jun 2020 03:22:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id B11576B008A for ; Tue, 30 Jun 2020 03:22:38 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7895E824556B for ; Tue, 30 Jun 2020 07:22:38 +0000 (UTC) X-FDA: 76985035596.19.land93_080e36126e76 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 525B71ACEA4 for ; Tue, 30 Jun 2020 07:22:38 +0000 (UTC) X-HE-Tag: land93_080e36126e76 X-Filterd-Recvd-Size: 5956 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 07:22:37 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id dm12so8823924qvb.9 for ; Tue, 30 Jun 2020 00:22:37 -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=YUb/R43ZMssEKSKqN14RVEh1G5REfGOWpdb3ieNJiMU=; b=gOzXbiGvAcHgG9UYZFrhTZx/xxwMREB2h3FyW1s/GNRjauXXFRFeFNLlTtWgyE/HD/ WUwvGJNvfNCTaaFWaE80gjxJHWiVtb+YHBMXzGLOGqksNvnn2anA2KTlrIC8NIxZjP2n SwxdCptGcM2slAMWCToErm1+bwmY3oVeR3wdEm3qyzpPjclyz4YGrpAimMqP216l9oZL RJ3dpYvE+wW0Pfnp2xZvnWicRbgDzD4Z3QwqJQmgBrIpRfC4GwldbQTFKlirLW6DvSPl QLfyNEnRwcTnChkQXbA7T2gfm9pykH5yG7hn2BRoKB6DDvTj7avCwnP6b38gJTjYXsiL Vmmg== 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=YUb/R43ZMssEKSKqN14RVEh1G5REfGOWpdb3ieNJiMU=; b=VcjPqqYYbQrdEFpStzhMX3b7k5EeKpRzA2M1gFP2zLeo2901UGNz8dMgZtsmmY2dIi ILun/B3kb5EhJOKgF6HQdmUXzaxus5olumaah/C9CKzMpvC0HWyHWFW87IZUJKoIk0j3 QMmPIYrsQ1zcXpFgffVPT88uf8qb5Gz/OzKwzGAY9cOQJGinSn804JkjlbsZsN5g2cuC ZIioXiDZhlumu3lLr2SOYU0k1F0e/K+gPr+YNJCwSbdpXASG8sVjtSEdkApAkYfPeiK5 nXkB9+CL4MFfmBCM+IOMh+aZf3JIdQxpaIDlC2/9mh6VuJykS35lR9dFzFYB5Hn0nlWa 64mg== X-Gm-Message-State: AOAM531JV1ex/PKFyxQ/965YAIUYkF4wg6gvU8jO/SVqIx+apMrcN5oC vqAAP6QO2U66yOGfifTMS8qksaDCCwD5qSxUet8= X-Google-Smtp-Source: ABdhPJw7Sh9pRpAxYP0KNguzmQTPOcCN248K7MQK4XOtXpVblcIPHBVLtKkKxLX6tZdJDGjgDgQXRql9vENUrZdA88g= X-Received: by 2002:a0c:84c2:: with SMTP id m60mr18687200qva.198.1593501757040; Tue, 30 Jun 2020 00:22:37 -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> <20200629075510.GA32461@dhcp22.suse.cz> <20200630064256.GB2369@dhcp22.suse.cz> In-Reply-To: <20200630064256.GB2369@dhcp22.suse.cz> From: Joonsoo Kim Date: Tue, 30 Jun 2020 16:22:22 +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: 525B71ACEA4 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 30=EC=9D=BC (=ED=99=94) =EC=98=A4=ED=9B=84 3:42, M= ichal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > On Tue 30-06-20 15:30:04, Joonsoo Kim wrote: > > 2020=EB=85=84 6=EC=9B=94 29=EC=9D=BC (=EC=9B=94) =EC=98=A4=ED=9B=84 4:5= 5, Michal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > [...] > > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > > > index 57ece74e3aae..c1595b1d36f3 100644 > > > --- a/mm/hugetlb.c > > > +++ b/mm/hugetlb.c > > > @@ -1092,10 +1092,14 @@ static struct page *dequeue_huge_page_nodemas= k(struct hstate *h, gfp_t gfp_mask, > > > /* Movability of hugepages depends on migration support. */ > > > static inline gfp_t htlb_alloc_mask(struct hstate *h) > > > { > > > + gfp_t gfp; > > > + > > > if (hugepage_movable_supported(h)) > > > - return GFP_HIGHUSER_MOVABLE; > > > + gfp =3D GFP_HIGHUSER_MOVABLE; > > > else > > > - return GFP_HIGHUSER; > > > + gfp =3D GFP_HIGHUSER; > > > + > > > + return current_gfp_context(gfp); > > > } > > > > > > static struct page *dequeue_huge_page_vma(struct hstate *h, > > > > > > If we even fix this general issue for other allocations and allow a > > > better CMA exclusion then it would be implemented consistently for > > > everybody. > > > > Yes, I have reviewed the memalloc_nocma_{} APIs and found the better wa= y > > for CMA exclusion. I will do it after this patch is finished. > > > > > Does this make more sense to you are we still not on the same page wr= t > > > to the actual problem? > > > > Yes, but we have different opinions about it. As said above, I will mak= e > > a patch for better CMA exclusion after this patchset. It will make > > code consistent. > > I'd really appreciate it if you wait until then. > > As I've said I would _prefer_ simplicity over "correctness" if it is only > partial and hard to reason about from the userspace experience but this > is not something I would _insist_ on. If Mike as a maintainer of the > code is ok with that then I will not stand in the way. Okay. > But please note that a missing current_gfp_context inside > htlb_alloc_mask is a subtle bug. I do not think it matters right now but > with a growing use of scoped apis this might actually hit some day so I > believe we want to have it in place. Okay. I will keep in mind and consider it when fixing CMA exclusion on the other patchset. Thanks.