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.0 required=3.0 tests=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 E4287C433DF for ; Tue, 30 Jun 2020 06:43:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF7E9207D0 for ; Tue, 30 Jun 2020 06:43:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF7E9207D0 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 3FC5D6B008C; Tue, 30 Jun 2020 02:43:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3ACCA6B0095; Tue, 30 Jun 2020 02:43:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29C806B0096; Tue, 30 Jun 2020 02:43:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id D80CC6B008C for ; Tue, 30 Jun 2020 02:43:00 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 67C3A181AC9CB for ; Tue, 30 Jun 2020 06:43:00 +0000 (UTC) X-FDA: 76984935720.27.map03_0a05f8626e75 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 403023D669 for ; Tue, 30 Jun 2020 06:43:00 +0000 (UTC) X-HE-Tag: map03_0a05f8626e75 X-Filterd-Recvd-Size: 5183 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 06:42:59 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id b15so15079140edy.7 for ; Mon, 29 Jun 2020 23:42:59 -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=T68iAtCbsB3kK12Vx7XZijyxS7QJWskLFeow15TOzcM=; b=fChDiM3mdTaBOM2x3TBJk9IRoafuyFPLUbKzs5Q0kth1UgRhI6y1SFzsA6MF8rwt5G 51lyeGKb9CGr8EpO9Bsa+0uGBKPaJw1Dkx1+5EpSMan4MCZ5TgU7VsPCABpiW1Wf8LVJ yMqG+34x3btNHrvbmxl5kWVD1jdoCH5mEksskAbqmHOcOtxjcIrXOJEAq2gzysS4r+S4 Adp4jY+u3x5XOFGejw+jnevkZVcyuzz5FNwM5a4Dv7C1Bfg2sZE/W+/KjowtsD2sA+x9 jw+aDlz8j4RRie4lrX593G9SVBLaw4nGBVXhbynuvfy5VO6NGplJb0UkevEZBbNcngi0 u3aw== X-Gm-Message-State: AOAM530S4y+cq/XFWR2PnQLsLC8cSeQdv6QlAanSfnuQ4IdTMyeCX4kx OIU/P/692cH2zTcAJ8OfnKM= X-Google-Smtp-Source: ABdhPJz+FSxFS8S+qi2OPftX4/hQH0ksmkIkftRZWCRq/OCxpS+D7qZ7LW1yMd09KDh9aUsimIrllw== X-Received: by 2002:a05:6402:559:: with SMTP id i25mr13399059edx.35.1593499378880; Mon, 29 Jun 2020 23:42:58 -0700 (PDT) Received: from localhost (ip-37-188-168-3.eurotel.cz. [37.188.168.3]) by smtp.gmail.com with ESMTPSA id m6sm1239903ejq.85.2020.06.29.23.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 23:42:58 -0700 (PDT) Date: Tue, 30 Jun 2020 08:42:56 +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: <20200630064256.GB2369@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> <20200626072324.GT1320@dhcp22.suse.cz> <20200629075510.GA32461@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 403023D669 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 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. >=20 > 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. >=20 > > Does this make more sense to you are we still not on the same page wr= t > > to the actual problem? >=20 > 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. 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. Thanks! --=20 Michal Hocko SUSE Labs