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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 459ADC433E6 for ; Mon, 25 Jan 2021 19:42:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C52A622525 for ; Mon, 25 Jan 2021 19:42:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C52A622525 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E6AE08D0024; Mon, 25 Jan 2021 14:42:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E1AF88D0023; Mon, 25 Jan 2021 14:42:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D07818D0024; Mon, 25 Jan 2021 14:42:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id B8F6F8D0023 for ; Mon, 25 Jan 2021 14:42:39 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6EC213649 for ; Mon, 25 Jan 2021 19:42:39 +0000 (UTC) X-FDA: 77745319638.28.cork87_3102f5d27588 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 389C06C3E for ; Mon, 25 Jan 2021 19:42:39 +0000 (UTC) X-HE-Tag: cork87_3102f5d27588 X-Filterd-Recvd-Size: 5367 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Mon, 25 Jan 2021 19:42:38 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id e9so8319543plh.3 for ; Mon, 25 Jan 2021 11:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5fVcl4vKZHTggDm2blzFERgcHQ62HSz/1Q2cJ06nrTg=; b=LL0FJhwoQrn7tUXdzpAdVeTxvpcnKljV3FZHqFh2MW1Nn7kU9DyudKg56dc5WEr9b6 ELm2u/F2CynFbqQtnbVH2jrvb8lb1owWggFXMi984iR8HTHAcY72RwkpQdyg8kYvD0M1 RisgAaxjOP+vvR3/e714JnzZEN1qwfV0D1os8EX74vck3vQUmCO2GgBK9koYeN27koOW Oq/LfzpLUKcvcfMc32E+juzk5/cvnCxX4FrhUoAcKQP0Bjh2fnlHpW4kRlYQMjxX55tt +nQ1Esa8G7u99N3yLi5Bo5MB2j6DnvTMZuy699sUzV5zcXDX1JNVbLcKFO77mPxxlt2v 2tgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=5fVcl4vKZHTggDm2blzFERgcHQ62HSz/1Q2cJ06nrTg=; b=Mkhu/1M/Ab4t6xQ46RIsJfZQ8fFqVg7S/5e+uD3Tq1dJ++4UtZkjRZSxzP07RKP30M +GMRpPGYFQ7Igoa48+Pw6ghQ7d/nEwzu6vHW3kF957/1287bAWi0YWdMJJQtZeYsDH+U IklPGWpRzXCPhAYuwSQpUDmXJE/oPlDm1ggN6U28yzeGT0+w6iMbSDzMWA+8DfnBwcTZ gqkIz4Xr2OYwXJYDmFmGn1v1WwBOir+Qg7RMXmbW0x6ErMESpOnJQw5i9wLANsdoxikR heQkAdsIqoBx/S81NiOF6ZSMPZp+qf/41c4CsyJWzwqPDUI5X8xtTbnUKX9YLPsltbS5 05bA== X-Gm-Message-State: AOAM5332WCo/f0r09zXueRnhXHkLdlD0/aaB3hxU0QXNc6HcdxioUcbu qwO2eYH7BVvvIc8dgjTjrbA= X-Google-Smtp-Source: ABdhPJwT/YZ72o8PzSOo3q/xaeqNAkBX8xQi8IOdnfyF1Y2kFh41Roa9xrm8PNLtM8E9l0D9llOWOA== X-Received: by 2002:a17:90a:7e90:: with SMTP id j16mr1784454pjl.163.1611603757872; Mon, 25 Jan 2021 11:42:37 -0800 (PST) Received: from google.com ([2620:15c:211:201:e8b4:4688:79de:94f3]) by smtp.gmail.com with ESMTPSA id h6sm17733599pfr.47.2021.01.25.11.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 11:42:36 -0800 (PST) Date: Mon, 25 Jan 2021 11:42:34 -0800 From: Minchan Kim To: Michal Hocko Cc: Andrew Morton , linux-mm , LKML , hyesoo.yu@samsung.com, david@redhat.com, surenb@google.com, pullip.cho@samsung.com, joaodias@google.com, hridya@google.com, john.stultz@linaro.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, hch@infradead.org, robh+dt@kernel.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v4 1/4] mm: cma: introduce gfp flag in cma_alloc instead of no_warn Message-ID: References: <20210121175502.274391-1-minchan@kernel.org> <20210121175502.274391-2-minchan@kernel.org> <20210125130701.GF827@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210125130701.GF827@dhcp22.suse.cz> 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 Mon, Jan 25, 2021 at 02:07:01PM +0100, Michal Hocko wrote: > On Thu 21-01-21 09:54:59, Minchan Kim wrote: > > The upcoming patch will introduce __GFP_NORETRY semantic > > in alloc_contig_range which is a failfast mode of the API. > > Instead of adding a additional parameter for gfp, replace > > no_warn with gfp flag. > > > > To keep old behaviors, it follows the rule below. > > > > no_warn gfp_flags > > > > false GFP_KERNEL > > true GFP_KERNEL|__GFP_NOWARN > > gfp & __GFP_NOWARN GFP_KERNEL | (gfp & __GFP_NOWARN) > > > > Reviewed-by: Suren Baghdasaryan > > Signed-off-by: Minchan Kim > [...] > > diff --git a/mm/cma.c b/mm/cma.c > > index 0ba69cd16aeb..d50627686fec 100644 > > --- a/mm/cma.c > > +++ b/mm/cma.c > > @@ -419,13 +419,13 @@ static inline void cma_debug_show_areas(struct cma *cma) { } > > * @cma: Contiguous memory region for which the allocation is performed. > > * @count: Requested number of pages. > > * @align: Requested alignment of pages (in PAGE_SIZE order). > > - * @no_warn: Avoid printing message about failed allocation > > + * @gfp_mask: GFP mask to use during the cma allocation. > > Call out supported gfp flags explicitly. Have a look at kvmalloc_node > for a guidance. How about this? diff --git a/mm/cma.c b/mm/cma.c index d50627686fec..b94727b694d6 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -423,6 +423,10 @@ static inline void cma_debug_show_areas(struct cma *cma) { } * * This function allocates part of contiguous memory on specific * contiguous memory area. + * + * For gfp_mask, GFP_KERNEL and __GFP_NORETRY are supported. __GFP_NORETRY + * will avoid costly functions(e.g., waiting on page_writeback and locking) + * at current implementaion during the page migration. */ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, gfp_t gfp_mask)