linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@lst.de>, Baoquan He <bhe@redhat.com>
Cc: John Donnelly <john.p.donnelly@oracle.com>,
	David Hildenbrand <david@redhat.com>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dma/pool: do not complain if DMA pool is not allocated
Date: Fri, 25 Mar 2022 13:58:42 +0100	[thread overview]
Message-ID: <Yj28gjonUa9+0yae@dhcp22.suse.cz> (raw)
In-Reply-To: <20220325122559.14251-1-mhocko@kernel.org>

On Fri 25-03-22 13:25:59, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> we have a system complainging about order-5 allocation for the DMA pool.
> This is something that a674e48c5443 ("dma/pool: create dma atomic pool
> only if dma zone has managed pages") has already tried to achieve but I
> do not think it went all the way to have it covered completely. In this
> particular case has_managed_dma() will not work because:
> [    0.678539][    T0] Initmem setup node 0 [mem 0x0000000000001000-0x000000027dffffff]
> [    0.686316][    T0] On node 0, zone DMA: 1 pages in unavailable ranges
> [    0.687093][    T0] On node 0, zone DMA32: 36704 pages in unavailable ranges
> [    0.694278][    T0] On node 0, zone Normal: 53252 pages in unavailable ranges
> [    0.701257][    T0] On node 0, zone Normal: 8192 pages in unavailable ranges

Dang, I have just realized that I have misread the boot log and it has
turned out that a674e48c5443 is covering my situation because the
allocation failure message says:
Node 0 DMA free:0kB boost:0kB min:0kB low:0kB high:0kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:636kB managed:0kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB

I thought there are only few pages in the managed by the DMA zone. This
is still theoretically possible so I think __GFP_NOWARN makes sense here
but it would require to change the patch description.

Is this really worth it?

> 
> The allocation failure on the DMA zone shouldn't be really critical for
> the system operation so just silence the warning instead.
> 
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
>  kernel/dma/pool.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
> index 4d40dcce7604..1bf6de398986 100644
> --- a/kernel/dma/pool.c
> +++ b/kernel/dma/pool.c
> @@ -205,7 +205,7 @@ static int __init dma_atomic_pool_init(void)
>  		ret = -ENOMEM;
>  	if (has_managed_dma()) {
>  		atomic_pool_dma = __dma_atomic_pool_init(atomic_pool_size,
> -						GFP_KERNEL | GFP_DMA);
> +						GFP_KERNEL | GFP_DMA | __GFP_NOWARN);
>  		if (!atomic_pool_dma)
>  			ret = -ENOMEM;
>  	}
> -- 
> 2.30.2

-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2022-03-25 12:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 12:25 Michal Hocko
2022-03-25 12:58 ` Michal Hocko [this message]
2022-03-25 16:48   ` Christoph Hellwig
2022-03-25 16:54     ` Michal Hocko
2022-08-03  9:52       ` Michal Hocko
2022-08-03 14:59         ` Baoquan He
2022-08-03 15:05           ` Michal Hocko
2022-08-03 15:32             ` Baoquan He
2022-08-03 15:44               ` Michal Hocko
2022-08-04 11:01                 ` Baoquan He
2022-08-04 12:01                   ` Michal Hocko
2022-08-05 12:34                     ` Baoquan He
2022-08-05 17:37                       ` Michal Hocko
2022-08-09 15:37                         ` Michal Hocko
2022-08-10  1:32                           ` Andrew Morton
2022-08-10  6:40                             ` Michal Hocko
2022-08-10  2:19                           ` Baoquan He
2022-08-11  7:38                           ` Christoph Hellwig
2022-08-11  8:25                             ` Michal Hocko
2022-08-11  7:34                         ` Christoph Hellwig
2022-08-11  7:49                   ` Christoph Hellwig
2022-08-11  8:42                     ` Michal Hocko
2022-08-11  7:43                 ` Christoph Hellwig
2022-08-11  7:29               ` Christoph Hellwig
2022-08-11  7:28         ` Christoph Hellwig
2022-08-11  8:20           ` Michal Hocko
2022-08-11  8:21             ` Christoph Hellwig
2022-08-11  8:33               ` Michal Hocko
2022-08-11  7:27       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yj28gjonUa9+0yae@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=david@redhat.com \
    --cc=hch@lst.de \
    --cc=john.p.donnelly@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox