mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Qian Cai <cai@lca.pw>, jroedel@suse.de
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/iova: silence warnings under memory pressure
Date: Fri, 15 Nov 2019 13:13:03 -0800	[thread overview]
Message-ID: <f15994ec5b9c311677064583ff968b3cf881d4ab.camel@perches.com> (raw)
In-Reply-To: <1573851046-32384-1-git-send-email-cai@lca.pw>

On Fri, 2019-11-15 at 15:50 -0500, Qian Cai wrote:
> When running heavy memory pressure workloads, this 5+ old system is
> throwing endless warnings below because disk IO is too slow to recover
> from swapping. Since the volume from alloc_iova_fast() could be large,
> once it calls printk(), it will trigger disk IO (writing to the log
> files) and pending softirqs which could cause a loop and no progress
> from memory reclaim for days.
[]
> diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
[]
> @@ -233,7 +233,7 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad,
>  
>  struct iova *alloc_iova_mem(void)
>  {
> -	return kmem_cache_alloc(iova_cache, GFP_ATOMIC);
> +	return kmem_cache_alloc(iova_cache, GFP_ATOMIC | __GFP_NOWARN);
>  }
>  EXPORT_SYMBOL(alloc_iova_mem);

Is notification ever useful?

If so, maybe something like:

struct iova *alloc_iova_mem(void)
{
	void *mem = kmem_cache_alloc(iova_cache, GFP_ATOMIC | __GFP_NOWARN)_

	WARN_RATELIMIT(!mem, "%s: unable to alloc cache\n", __func__);

	return mem;
}

or maybe use printk_deferred or prink_deferred_once

?



  reply	other threads:[~2019-11-15 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 20:50 Qian Cai
2019-11-15 21:13 ` Joe Perches [this message]
2019-11-15 21:32   ` Qian Cai

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=f15994ec5b9c311677064583ff968b3cf881d4ab.camel@perches.com \
    --to=joe@perches.com \
    --cc=cai@lca.pw \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®