linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	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: Wed, 10 Aug 2022 10:19:23 +0800	[thread overview]
Message-ID: <20220810021923.GD373960@MiWiFi-R3L-srv> (raw)
In-Reply-To: <YvJ/V2bor9Q3P6ov@dhcp22.suse.cz>

On 08/09/22 at 05:37pm, Michal Hocko wrote:
> Here we go again.
> ---
> From 1dc9d7504624b273de47a88a9907f43533bfe08e Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@suse.com>
> Date: Fri, 25 Mar 2022 13:25:59 +0100
> Subject: [PATCH] dma/pool: do not complain if DMA pool is not allocated
> 
> we have a system complainging about order-10 allocation for the DMA pool.
> 
> [   14.017417][    T1] swapper/0: page allocation failure: order:10, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0-7
> [   14.017429][    T1] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.14.21-150400.22-default #1 SLE15-SP4 0b6a6578ade2de5c4a0b916095dff44f76ef1704
> [   14.017434][    T1] Hardware name: XXXX
> [   14.017437][    T1] Call Trace:
> [   14.017444][    T1]  <TASK>
> [   14.017449][    T1]  dump_stack_lvl+0x45/0x57
> [   14.017469][    T1]  warn_alloc+0xfe/0x160
> [   14.017490][    T1]  __alloc_pages_slowpath.constprop.112+0xc27/0xc60
> [   14.017497][    T1]  ? rdinit_setup+0x2b/0x2b
> [   14.017509][    T1]  ? rdinit_setup+0x2b/0x2b
> [   14.017512][    T1]  __alloc_pages+0x2d5/0x320
> [   14.017517][    T1]  alloc_page_interleave+0xf/0x70
> [   14.017531][    T1]  atomic_pool_expand+0x4a/0x200
> [   14.017541][    T1]  ? rdinit_setup+0x2b/0x2b
> [   14.017544][    T1]  __dma_atomic_pool_init+0x44/0x90
> [   14.017556][    T1]  dma_atomic_pool_init+0xad/0x13f
> [   14.017560][    T1]  ? __dma_atomic_pool_init+0x90/0x90
> [   14.017562][    T1]  do_one_initcall+0x41/0x200
> [   14.017581][    T1]  kernel_init_freeable+0x236/0x298
> [   14.017589][    T1]  ? rest_init+0xd0/0xd0
> [   14.017596][    T1]  kernel_init+0x16/0x120
> [   14.017599][    T1]  ret_from_fork+0x22/0x30
> [   14.017604][    T1]  </TASK>
> [...]
> [   14.018026][    T1] Node 0 DMA free:160kB 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:15996kB managed:15360kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
> [   14.018035][    T1] lowmem_reserve[]: 0 0 0 0 0
> [   14.018339][    T1] Node 0 DMA: 0*4kB 0*8kB 0*16kB 1*32kB (U) 0*64kB 1*128kB (U) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 160kB
> 
> The usable memory in the DMA zone is obviously too small for the pool
> pre-allocation. The allocation failure raises concern by admins because
> this is considered an error state.
> 
> In fact the preallocation itself doesn't expose any actual problem. It
> is not even clear whether anybody is ever going to use this pool. If yes
> then a warning will be triggered anyway.
> 
> Silence the warning to prevent confusion and bug reports.

LGTM,

Reviewed-by: Baoquan He <bhe@redhat.com>

> 
> 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
> 


  parent reply	other threads:[~2022-08-10  2:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 12:25 [PATCH] dma/pool: do not complain if DMA pool is not allocated Michal Hocko
2022-03-25 12:58 ` Michal Hocko
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 [this message]
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=20220810021923.GD373960@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --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 \
    --cc=mhocko@suse.com \
    /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;
as well as URLs for NNTP newsgroup(s).