Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1783028ybh; Fri, 17 Jul 2020 00:32:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU57RfP+YmD5RNsQ6YkZiNsYg1NU/9jbvwTuX9RyHTd//5Hn31qmfpO1AxCmcyj/g2eN6b X-Received: by 2002:aa7:c655:: with SMTP id z21mr8017356edr.330.1594971159508; Fri, 17 Jul 2020 00:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594971159; cv=none; d=google.com; s=arc-20160816; b=vB3bVWci38ZFAMQtgTzkavhJIuNZsiiApHLKS6cAedLr6/QoRBkRfacsAjIWmwa4ND ry8dF9972rUIjf9DhszCLYGJa1oIkX0t8zTsivWa81VgDkI7y/cGukxh+MaVVM8cQ0o0 E5tmYf7DN5kPglTIud4XddYW6Hnwxg1l8LnPi5QJSbnM40TTXpvxiQK+txasxUqR7w/v ya2wJMYBUgG3BReUaBHEhpZOvCM9Ukut24zq/SzZILKD0SiKb5f/i8e/0Kb+aXWSn9l5 vyLdqyf7jyOkrQolkTNtLicsQvhFei7bsQSqNxgKn2jcHKZpX1+0HS9mm5VBoR1WUSt5 cr3Q== 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=mLChhkkm0b+TcGslIoNpge2LNzljcXENkja9YaOyDFI=; b=igKV7HXqIIx4lEGAlpZhM45sHTckbbTGXMIhF0vDia1H9dx0vGsocK4tdjUtAdGvwT cp5dsbzS4M+JUAvr/pNPk95UxPeGo8+SCvSgnxThGZsbST31EfWFR3R2fGwmennby9Tc jN+2eLjpgRmYPY5Pwp6lYmIntXmyfq/aWajfpNgARAvAv0KNPDRmoMaMZN2Vmq6/5gCx nchwfmee5kOYC549rRhGs0e9o9ppCjgHHFnAkg0+tMIy4L8p7UVYKyCgY2U+XoBLEC+E 7MWoYg2xma7zrOsm1+ycsu/K4jDJitT8VXQavsTCx4GX6Ie1oHCQhE35r/Eg+QQQonE6 +tkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AuyJsg9n; 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 m8si4842109edv.543.2020.07.17.00.32.16; Fri, 17 Jul 2020 00:32: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=AuyJsg9n; 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 S1727965AbgGQH3a (ORCPT + 99 others); Fri, 17 Jul 2020 03:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbgGQH33 (ORCPT ); Fri, 17 Jul 2020 03:29:29 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929AFC061755; Fri, 17 Jul 2020 00:29:29 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id j10so6925331qtq.11; Fri, 17 Jul 2020 00:29:29 -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=mLChhkkm0b+TcGslIoNpge2LNzljcXENkja9YaOyDFI=; b=AuyJsg9n5JoeUqrQOWF2aN8tCVUZwOLo+QP4vwtT9hj9S4kfJaQzyi4p175ZcrAaNN bx1vS2zUGYSMMZVsWpCCobmmRuXkoumr/uV8NtivOnRR/QplBVJ9RNSrN4/568qjKEv6 8B/5BCMtYwl7pfQoJuH+bf4RY2JKUf2ZbT3qLbaQ+HspqJt/0fZedbTYgDnrGY1qkbB2 W4BZ7f/QxhZeN9nYmr3v9x+i4G/WlM69J45HWNLqaFvsDan9LS5mPxKau/JFk36uTTcI c0HjlAp/9+qj8jHjJ3Tm4R30CoImwKLFbKiyX6/1o/0VWNNhGtyV0JMu0XcIMbh95Rqd DXyA== 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=mLChhkkm0b+TcGslIoNpge2LNzljcXENkja9YaOyDFI=; b=YA3teFsyq58iLKEN0l1fpR311WsQ998ERlMYpomJkw9xJM86CDSpH6GSbjUehThpsW DjJeGIHfA7ZxXgUfc7q3QbPb51ENaLXdMSJXoVIyqgzz6tKV21BZV4rnvFmPp7kpW8RN /fdWCieGWRo7FpMwcprm2j89WjKB13hv/4X0AMDkSEixxwzoHZeAi1eF1CofjBiOBwr4 bwJHK94a/8XT8Scj/YVQ5dtHSlk3kuGNe/FTZTiMGmrdVszz0eTNoVf6m0A7wUk58KkC IUqQUuaD+szNlJBil1oJosmGZ3dlBwo4liJATzpD6YJs/G4hYgtxMdylo7vOMSbmYnJd 54sQ== X-Gm-Message-State: AOAM531D7yekWcGopmtFbf/UrqpZwhxLqr4iSUfjVtCk3w21fkjGLi6E 3BcAdWmwSi6Oi7jauelt0MFNczswY6sLhFKaaWQ= X-Received: by 2002:aed:22ef:: with SMTP id q44mr8639180qtc.333.1594970968809; Fri, 17 Jul 2020 00:29:28 -0700 (PDT) MIME-Version: 1.0 References: <1594789529-6206-1-git-send-email-iamjoonsoo.kim@lge.com> <332d620b-bfe3-3b69-931b-77e3a74edbfd@suse.cz> <6f18d999-4518-31ce-4cea-9b5b89a577ad@suse.cz> In-Reply-To: <6f18d999-4518-31ce-4cea-9b5b89a577ad@suse.cz> From: Joonsoo Kim Date: Fri, 17 Jul 2020 16:29:17 +0900 Message-ID: Subject: Re: [PATCH 1/4] mm/page_alloc: fix non cma alloc context To: Vlastimil Babka Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Michal Hocko , "Aneesh Kumar K . V" , Joonsoo Kim , stable@vger.kernel.org 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 7=EC=9B=94 16=EC=9D=BC (=EB=AA=A9) =EC=98=A4=ED=9B=84 4:45, V= lastimil Babka =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > On 7/16/20 9:27 AM, Joonsoo Kim wrote: > > 2020=EB=85=84 7=EC=9B=94 15=EC=9D=BC (=EC=88=98) =EC=98=A4=ED=9B=84 5:2= 4, Vlastimil Babka =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > >> > /* > >> > * get_page_from_freelist goes through the zonelist trying to alloc= ate > >> > * a page. > >> > @@ -3706,6 +3714,8 @@ get_page_from_freelist(gfp_t gfp_mask, unsigne= d int order, int alloc_flags, > >> > struct pglist_data *last_pgdat_dirty_limit =3D NULL; > >> > bool no_fallback; > >> > > >> > + current_alloc_flags(gfp_mask, &alloc_flags); > >> > >> I don't see why to move the test here? It will still be executed in th= e > >> fastpath, if that's what you wanted to avoid. > > > > I want to execute it on the fastpath, too. Reason that I moved it here > > is that alloc_flags could be reset on slowpath. See the code where > > __gfp_pfmemalloc_flags() is on. This is the only place that I can apply > > this option to all the allocation paths at once. > > But get_page_from_freelist() might be called multiple times in the slowpa= th, and > also anyone looking for gfp and alloc flags setup will likely not examine= this > function. I don't see a problem in having it in two places that already d= eal > with alloc_flags setup, as it is now. I agree that anyone looking alloc flags will miss that function easily. Oka= y. I will place it on its original place, although we now need to add one more place. *Three places* are gfp_to_alloc_flags(), prepare_alloc_pages() and __gfp_pfmemalloc_flags(). Thanks.