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=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 800AEC433E4 for ; Fri, 17 Jul 2020 08:46:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3647A20691 for ; Fri, 17 Jul 2020 08:46:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AuyJsg9n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3647A20691 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 CF5746B002D; Fri, 17 Jul 2020 04:46:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA53A6B002E; Fri, 17 Jul 2020 04:46:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE1EE6B002F; Fri, 17 Jul 2020 04:46:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id A8BF76B002D for ; Fri, 17 Jul 2020 04:46:28 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4BCFC1C9A2 for ; Fri, 17 Jul 2020 08:46:28 +0000 (UTC) X-FDA: 77046936456.23.copy41_460aaa626f09 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 639183F17A for ; Fri, 17 Jul 2020 08:44:19 +0000 (UTC) X-HE-Tag: copy41_460aaa626f09 X-Filterd-Recvd-Size: 4965 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jul 2020 08:44:18 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id c139so8051765qkg.12 for ; Fri, 17 Jul 2020 01:44:18 -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=AVK9KhKmbIQWCXw1sICEkIJrn0GJP3vVldcjR6nTeRgYPJdsU/PnSMs2sPlg42mghH fNXLCdBBm5bx0CDrsIYyU2wnzBAOk41l6P1u7n14G8qbwRRxWQNWnwVlF1qBH3FOogFn AIobK6TMoW40FBnM6JzHvKYO2cUKu5oHBexkvo13DvfHx0nmKPRYiacu/Ew3T1avdj0A 7lVovooGyyBs0RDOWR/aimI0ChUXSnf600IKfTVdZMgb8cziZp7jSGZbjvxPJUI3Y8b7 dJ8AGrNqOaY5lc5GHJjqhE25M7DbmB+nWLVl74BcJsUVcIcYABZPG1hT/RXyH1g0W+JY bs4Q== X-Gm-Message-State: AOAM530aPKYgCU5hlrJkm78CfMjJjuSDARaqr/Q/rjNoJ8xTCDLBJ9WF voqvadWeGWIxXwt5yJwyP02SZzjXZNJKXSiQAiCIVpoz X-Google-Smtp-Source: ABdhPJziixgd56ZvRi+F8Kf6fojTvIxqKFNW7APUzyaDkpth0ViJdo7U3bWUx0v9ZVJhf0he4zQc++fiB2R5T/6tFPE= 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 X-Rspamd-Queue-Id: 639183F17A X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000019, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.