lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201710251947.BIF34353.OFFFStOHQMJLVO@I-love.SAKURA.ne.jp>
Date:   Wed, 25 Oct 2017 19:47:04 +0900
From:   Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To:     mhocko@...nel.org
Cc:     akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, xiyou.wangcong@...il.com,
        hannes@...xchg.org, pmladek@...e.com, sergey.senozhatsky@...il.com,
        yuwang.yuwang@...baba-inc.com
Subject: Re: [PATCH] mm,page_alloc: Serialize out_of_memory() and allocation stall messages.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ