Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1777006ybh; Thu, 23 Jul 2020 18:08:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKfD6H1MDY61umFSzoD416aypCCjgZhN8sPx9fRWrEK4S+eijqpZVEeCBefeJKCQQXAgZm X-Received: by 2002:aa7:d814:: with SMTP id v20mr6741977edq.296.1595552927960; Thu, 23 Jul 2020 18:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595552927; cv=none; d=google.com; s=arc-20160816; b=a24Y9pFrDBJ40o6VncBSAXUhellmzMsdTZL9JH+IB/DvMhHyynYrUnngmX4FQg/i92 1gnDtctcP23CYg2HraFLFiLUDvPLNDPqFvlHMX41BDdVBOX1iw5+7u21/mkCPmEPOxjS ekBvMOfcDseHyK99Ik+Z56dIba40RyGmIY48iSqg5f/pAw8k6gl49tlwKempaZMNijma QJb5S34AZPFDIbwt3389YIy7GbggqqrtsF6TPN6ETMBvl39YRYdd49FaTrEYz6ARh5Mp a6XfimxrYAOhGS6FCdSbaJdvIgJP4UhmKpnvfsnixyl8erxflcJca1iFgZu9fskA3m0F ojnA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=v9LoounrO/wsDW18FBDSD4IQMa/GaW86lkv2NFBjj+A=; b=l1sxMlmb3yoShe32hvbhfKbtiYaIB0lyKkReinc7zzag5YElwH+KL3xkFC8UIK1c2C aYDomkdi3j40Ec30uXZtmisCIFTfGOfdHY14cqEYtWSKV58vNC6yF/sl90MK0qZvRhhx srNZhIukSC7foTCak7w2pr2uxO1EDDymX7AswGA2fOIRSLfmhrIWXxS9UHNXJOMQNbVr p2vxUm5fOypBZ+rfwRUWKrJb2A07Ma8R+KZmrnsUYoLwbXYy8+8cIjoFKSsd8yuupCUn 5chuXFBBxSd37DpLQmOkYaeWnbhCe2g9KtEHnPP0ycCVqY/7WgoU39Uygb/4ltYUzx4Y hhxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U6qUgPZW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si3076447edr.390.2020.07.23.18.08.25; Thu, 23 Jul 2020 18:08:47 -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=@kernel.org header.s=default header.b=U6qUgPZW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbgGXBIQ (ORCPT + 99 others); Thu, 23 Jul 2020 21:08:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:36140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbgGXBIQ (ORCPT ); Thu, 23 Jul 2020 21:08:16 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >