mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, mgorman@suse.de,
	dave.hansen@intel.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: How to make warn_alloc() reliable?
Date: Tue, 18 Oct 2016 14:27:49 +0200	[thread overview]
Message-ID: <20161018122749.GE12092@dhcp22.suse.cz> (raw)
In-Reply-To: <201610182004.AEF87559.FOOHVLJOQFFtSM@I-love.SAKURA.ne.jp>

On Tue 18-10-16 20:04:20, Tetsuo Handa wrote:
[...]
> @@ -1697,11 +1697,25 @@ static bool inactive_reclaimable_pages(struct lruvec *lruvec,
>  	int file = is_file_lru(lru);
>  	struct pglist_data *pgdat = lruvec_pgdat(lruvec);
>  	struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
> +	unsigned long wait_start = jiffies;
> +	unsigned int wait_timeout = 10 * HZ;
> +	long last_diff = 0;
> +	long diff;
>  
>  	if (!inactive_reclaimable_pages(lruvec, sc, lru))
>  		return 0;
>  
> -	while (unlikely(too_many_isolated(pgdat, file, sc))) {
> +	while (unlikely((diff = too_many_isolated(pgdat, file, sc)) > 0)) {
> +		if (diff < last_diff) {
> +			wait_start = jiffies;
> +			wait_timeout = 10 * HZ;
> +		} else if (time_after(jiffies, wait_start + wait_timeout)) {
> +			warn_alloc(sc->gfp_mask,
> +				   "shrink_inactive_list() stalls for %ums",
> +				   jiffies_to_msecs(jiffies - wait_start));
> +			wait_timeout += 10 * HZ;
> +		}
> +		last_diff = diff;
>  		congestion_wait(BLK_RW_ASYNC, HZ/10);
>  
>  		/* We are about to die and free our memory. Return now. */
> ----------
[...]
> So, how can we make warn_alloc() reliable?

This is not about warn_alloc reliability but more about
too_many_isolated waiting for an unbounded amount of time. And that
should be fixed. I do not have a good idea how right now.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2016-10-18 12:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 11:04 Tetsuo Handa
2016-10-18 12:27 ` Michal Hocko [this message]
2016-10-19 11:27   ` Tetsuo Handa
2016-10-19 11:55     ` Michal Hocko
2016-10-20 12:07       ` Tetsuo Handa
2016-10-20 19:30         ` Michal Hocko

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=20161018122749.GE12092@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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®