linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: mhocko@kernel.org
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, xiyou.wangcong@gmail.com,
	hannes@cmpxchg.org, pmladek@suse.com,
	sergey.senozhatsky@gmail.com, yuwang.yuwang@alibaba-inc.com
Subject: Re: [PATCH] mm,page_alloc: Serialize out_of_memory() and allocation stall messages.
Date: Wed, 25 Oct 2017 19:47:04 +0900	[thread overview]
Message-ID: <201710251947.BIF34353.OFFFStOHQMJLVO@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <201710242023.GHE48971.SQHtFFLFVJOMOO@I-love.SAKURA.ne.jp>

Tetsuo Handa wrote:
> While warn_alloc() messages are completely unreadable, what we should note are that
> 
>  (a) out_of_memory() => oom_kill_process() => dump_header() => show_mem() => printk()
>      got stuck at console_unlock() despite this is schedulable context.
> 
> ----------
> 2180:   for (;;) {
> 2181:           struct printk_log *msg;
> 2182:           size_t ext_len = 0;
> 2183:           size_t len;
> 2184:
> 2185:           printk_safe_enter_irqsave(flags);
> 2186:           raw_spin_lock(&logbuf_lock);
> (...snipped...)
> 2228:           console_idx = log_next(console_idx);
> 2229:           console_seq++;
> 2230:           raw_spin_unlock(&logbuf_lock);
> 2231:
> 2232:           stop_critical_timings();        /* don't trace print latency */
> 2233:           call_console_drivers(ext_text, ext_len, text, len);
> 2234:           start_critical_timings();
> 2235:           printk_safe_exit_irqrestore(flags); // console_unlock+0x24e/0x4c0 is here.
> 2236:
> 2237:           if (do_cond_resched)
> 2238:                   cond_resched();
> 2239:   }
> ----------

It turned out that cond_resched() was not called due to do_cond_resched == 0 due to
preemptible() == 0 due to CONFIG_PREEMPT_COUNT=n despite CONFIG_PREEMPT_VOLUNTARY=y,
for CONFIG_PREEMPT_VOLUNTARY itself does not select CONFIG_PREEMPT_COUNT. Surprising...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2017-10-25 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 10:51 Tetsuo Handa
2017-10-19 11:44 ` Michal Hocko
2017-10-20 10:20   ` Tetsuo Handa
2017-10-24 11:23     ` Tetsuo Handa
2017-10-25 10:47       ` Tetsuo Handa [this message]

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=201710251947.BIF34353.OFFFStOHQMJLVO@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=pmladek@suse.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yuwang.yuwang@alibaba-inc.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