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=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 11998C433E3 for ; Fri, 24 Jul 2020 01:08:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A393D20714 for ; Fri, 24 Jul 2020 01:08:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="U6qUgPZW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A393D20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1018E8D000E; Thu, 23 Jul 2020 21:08:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B2E68D0003; Thu, 23 Jul 2020 21:08:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE2128D000E; Thu, 23 Jul 2020 21:08:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id D88F48D0003 for ; Thu, 23 Jul 2020 21:08:17 -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 453B4181AC537 for ; Fri, 24 Jul 2020 01:08:17 +0000 (UTC) X-FDA: 77071183434.27.class60_2800b4a26f43 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 1CE6015C30 for ; Fri, 24 Jul 2020 01:08:17 +0000 (UTC) X-HE-Tag: class60_2800b4a26f43 X-Filterd-Recvd-Size: 3399 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Fri, 24 Jul 2020 01:08:16 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 32D75206E3; Fri, 24 Jul 2020 01:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595552895; bh=6h79p/EBOO3Jy0O+wNOK5EBNEFcadFue56VbMpxqAfc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U6qUgPZWAddKYwPy75j0iJwMI0u7S1FZpM6Htu3VLY43Bakop2yGaOQ9zNk4AziSP 53D1qwpryq4oHD4AiwkI+gotw+lxwjvctrEhhPyUC0n+Mq/lNkChZh851He3nbqrnb kyBgjWWAPAHtSzqP28cKb+eLLNplXpnk9987gJsU= Date: Thu, 23 Jul 2020 18:08:14 -0700 From: Andrew Morton To: js1304@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, 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 Subject: Re: [PATCH v2] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs Message-Id: <20200723180814.acde28b92ce6adc785a79120@linux-foundation.org> In-Reply-To: <1595468942-29687-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1595468942-29687-1-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1CE6015C30 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: 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(). However, > 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? > Second, clearing __GFP_MOVABLE in current_gfp_context() has a side effect > 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. 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? > To fix these problems, this patch changes the implementation to exclude > CMA area in page allocation. Main point of this change is using the > alloc_flags. alloc_flags is mainly used to control allocation so it fits > for excluding CMA area in allocation. >