Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1502946

Re: How to make warn_alloc() reliable?

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: How to make warn_alloc() reliable?
Date 2016-10-18 14:30 +0200
Message-ID <stBGO-1Bc-15@gated-at.bofh.it> (permalink)
References <stArn-Pg-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to make warn_alloc() reliable? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-10-18 13:10 +0200
  Re: How to make warn_alloc() reliable? Michal Hocko <mhocko@kernel.org> - 2016-10-18 14:30 +0200
    Re: How to make warn_alloc() reliable? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-10-19 16:20 +0200
      Re: How to make warn_alloc() reliable? Michal Hocko <mhocko@kernel.org> - 2016-10-19 16:40 +0200
        Re: How to make warn_alloc() reliable? Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-10-20 14:10 +0200
          Re: How to make warn_alloc() reliable? Michal Hocko <mhocko@kernel.org> - 2016-10-20 21:40 +0200

csiph-web