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, URIBL_BLOCKED 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 28B41C433E8 for ; Fri, 24 Jul 2020 02:24:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA76020888 for ; Fri, 24 Jul 2020 02:24:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U1hYBfMc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA76020888 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 21D038D0003; Thu, 23 Jul 2020 22:24:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CD946B0027; Thu, 23 Jul 2020 22:24:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E4298D0003; Thu, 23 Jul 2020 22:24:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EDBE16B000D for ; Thu, 23 Jul 2020 22:24:04 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 69BDA1264B for ; Fri, 24 Jul 2020 02:24:04 +0000 (UTC) X-FDA: 77071374408.06.steel86_000744526f43 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 3C7441003982F for ; Fri, 24 Jul 2020 02:24:04 +0000 (UTC) X-HE-Tag: steel86_000744526f43 X-Filterd-Recvd-Size: 5150 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 24 Jul 2020 02:24:03 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id l23so7451858qkk.0 for ; Thu, 23 Jul 2020 19:24:03 -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=e+jZCuU3Ve6QR85zz/PL3yFkpaft9ds9mBhO6o6ZpyY=; b=U1hYBfMcnyvMs+MLC9D8LqGdUxOMlYQIWWNO0j8ynexGUjP4w9D5yMJm0Ntse7qcYn rhFR3y42TEOVrgcYjwaM0PIanHcrRQtN7+woDWaFv3zniPgy/UFsBAShCXlqpCeUkX6R 3dIzHByqgNHdBVAgJXjdaVTRj/pGXLhTzO6aaUsr/PO6lr/SQn0SD4iFNZcAy5Bw703u vrqhnFJF4Ymop7BnvwLL1XqVb/urs0FkxyGtFQRK0savf8JqkjIBf+imw/5bgQ18qGuq dz2YutXRgfbuW7P45Bn8VpKiaVC8pAuv7JmCx4sXtL0iT9RAvhSy2UBieWoaVF+8c+XE oN1g== 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=e+jZCuU3Ve6QR85zz/PL3yFkpaft9ds9mBhO6o6ZpyY=; b=VitxN9gk2rdaubOaZMQsRJ7ID06/oLK71dxS9Ox5YZQAkmuPetDw3SU1AqjOlkzow+ DU3jS/Ae1oSV2X8fTD6Htaa3h5njPLUYTVoHTAGK5ebtAjymb6Z8xY8K4Nyaz1xR0tgd XK9HTuMW2Dxwqbr+UekXtzTS2gkE6eJlkhQ2ArfNvHfMEHR6nYhTU6P9yEpr5VmwIVID sw3DPVdAOcRuDl4yRAyhv08v3GAWgBDglLzqYu2f8I9F5ptVqCp5Eo+AbJapaQjPhVJo WaPg/ug56qTHkIzx6jpMRDVmGX2B0qqmZ5ZrSrm3/gIjgN2cOCb6iNggNFd73cFztft4 c3FQ== X-Gm-Message-State: AOAM533zAIbgBjj+eIM76uqhsUPFLv+rwDAX8U7ibAjQivslw/yu7c6D yAujrCQHDqmn0ksqr/3R/bqKz+Pkvtevi9jAI9E= X-Google-Smtp-Source: ABdhPJxqsC3pLWE/fyOiunBBLjtuZ7bZwqLt4KjdFH0iouvpdDH+V0oGQljmm0q99xmB/mDs+Yfu5TStxwRowM6JPPc= X-Received: by 2002:a37:9b95:: with SMTP id d143mr7937124qke.272.1595557443029; Thu, 23 Jul 2020 19:24:03 -0700 (PDT) MIME-Version: 1.0 References: <1595468942-29687-1-git-send-email-iamjoonsoo.kim@lge.com> <20200723180814.acde28b92ce6adc785a79120@linux-foundation.org> In-Reply-To: <20200723180814.acde28b92ce6adc785a79120@linux-foundation.org> From: Joonsoo Kim Date: Fri, 24 Jul 2020 11:23:52 +0900 Message-ID: Subject: Re: [PATCH v2] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs To: Andrew Morton Cc: Linux Memory Management List , LKML , kernel-team@lge.com, Vlastimil Babka , 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: 3C7441003982F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 7=EC=9B=94 24=EC=9D=BC (=EA=B8=88) =EC=98=A4=EC=A0=84 10:08, = Andrew Morton =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84= =B1: > > On Thu, 23 Jul 2020 10:49:02 +0900 js1304@gmail.com wrote: > > > From: Joonsoo Kim > > > > Currently, memalloc_nocma_{save/restore} API that prevents CMA area > > in page allocation is implemented by using current_gfp_context(). Howev= er, > > there are two problems of this implementation. > > > > First, this doesn't work for allocation fastpath. In the fastpath, > > original gfp_mask is used since current_gfp_context() is introduced in > > order to control reclaim and it is on slowpath. So, CMA area can be > > allocated through the allocation fastpath even if > > memalloc_nocma_{save/restore} APIs are used. > > Whoops. > > > Currently, there is just > > one user for these APIs and it has a fallback method to prevent actual > > problem. > > Shouldn't the patch remove the fallback method? It's not just the fallback but it also has its own functionality. So, we should not remove it. > > Second, clearing __GFP_MOVABLE in current_gfp_context() has a side effe= ct > > to exclude the memory on the ZONE_MOVABLE for allocation target. > > More whoops. > > Could we please have a description of the end-user-visible effects of > this change? Very much needed when proposing a -stable backport, I think= . In fact, there is no noticeable end-user-visible effect since the fallback = would cover the problematic case. It's mentioned in the commit description. Perha= p, performance would be improved due to reduced retry and more available memor= y (we can use ZONE_MOVABLE with this patch) but it would be neglectable. > d7fefcc8de9147c is over a year old. Why did we only just discover > this? This makes one wonder how serious those end-user-visible effects > are? As mentioned above, there is no visible problem to the end-user. Thanks.