Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3363742ybt; Tue, 30 Jun 2020 00:26:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzgxMahpEKWNv/SesF8rklNgTIe3Cp3s6AXAAvxc/FJ4iFimNOrSnqhswO2vRJE/psZ518 X-Received: by 2002:aa7:d952:: with SMTP id l18mr21098030eds.151.1593501999871; Tue, 30 Jun 2020 00:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593501999; cv=none; d=google.com; s=arc-20160816; b=zAIBEbEK9ogRREMfW83UhvHjb4/70GqM+IgnGTLWnehbLl+9TXR+zT4mD6BKOT8ARU c7Q/smAZFm+ONOnb3n1A2JW3lrr0SzZKTKBs2zdEWqbL4fbC3k7uTYiv4e3fv3+d0tFC sLH5Q2DVxlILrJb123vSqdE+EdgWLhKEJnjBS9kx4zfpk1NzOeLnbN+KUA9k+Vi6PPvK sPbQZumxpLDCyEJ5Gx8/NruFmfn27eWaYlLnPwufSDmGCyYR89NdpXOxzI1rYnzS03HV tcusWT7JRIB0VBWnFR0vjptG9SEu2xXMWVu6JvdOL6yZdV5wZa4ocmkeUn5TrciC8Aqt oL8Q== 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=YUb/R43ZMssEKSKqN14RVEh1G5REfGOWpdb3ieNJiMU=; b=mWM2VlKV3csgl1VjzWI37pOJznmuOgg/YvaAWIWhZ+5BM59fhTwPuYbEUdvlbo9odW kxrGtjm+eulqye8G/xpJV/GNfPIFp3OCjkCCxnnG2+6wVWveKew8Pwc1X8EaredvIPwp gTZgKdNTOtiXucP5QOT1y7tJM6YReVpuhuxLczEdSaCV39yiOtLQjdqQIJ5VNgt4xXSz Rxls51vjudkETd8kdUL/lT9uuTjZbfICYcpSCRc2s6kfo3H5wOlQFHYLIodNFf3F3aXU Oo61dPsC0t/bEh84w/HRLU8TqVgV6VZbxJVZLsAClTRtdToPsAxyQtavYQtBgFx0z9EF OdVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gOzXbiGv; 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 p7si1195960ejy.206.2020.06.30.00.26.17; Tue, 30 Jun 2020 00:26:39 -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=gOzXbiGv; 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 S1730894AbgF3HWj (ORCPT + 99 others); Tue, 30 Jun 2020 03:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730636AbgF3HWi (ORCPT ); Tue, 30 Jun 2020 03:22:38 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B35BBC061755 for ; Tue, 30 Jun 2020 00:22:38 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id t7so8821049qvl.8 for ; Tue, 30 Jun 2020 00:22:38 -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=H3a3wkRbLUWWvLfwoYXKfQPtSSeqWx15ozj7DeaNZXmvySRYaOxdA4cHguhhGXh+8j DmKrcvdHZRZQf23pKAeSOF1jAwj6dFvD4pF21QzhgTP/jABH0IFCSiCBQhTSxi+q8XL3 Hu6fXJL7oOtzbzOYLmGWxVqq/VgQB8eX+JZeZUUf3cPKV6xlN654gMG0FOnQrVtdXYrv 4kxUFuj8Js1fcyc7j4WmXU452DYNk+z57PZcsb2r+cAHuocRDMIp3jNkSel0ICq11llb JYgnx6+SIjA6AA6L5X/Ar0FY88nc5JVoN4V6mn+BXQjeOUmHMlyq3mQpYOXSP58KOHXz /EGw== X-Gm-Message-State: AOAM531XuqvgxmxDhVnx+IYFZOxTl2Isqs+//KLDmquzMyBaKGj6VB6b fdX1oXQo3tGSB3fg0LEBuiRfLaK0Gkjyit6yCmw= 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.