All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jiri Kosina <jkosina@suse.com>,
	ksummit-discuss@lists.linuxfoundation.org,
	Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	Viresh Kumar <viresh.kumar@linaro.org>, Tejun Heo <tj@kernel.org>
Subject: Re: [Ksummit-discuss] [TECH TOPIC] asynchronous printk
Date: Wed, 20 Jul 2016 11:08:27 +0900	[thread overview]
Message-ID: <20160720020827.GA660@swordfish> (raw)
In-Reply-To: <1468951082.2383.29.camel@HansenPartnership.com>

Hello,

On (07/19/16 10:58), James Bottomley wrote:
[..]
> > yes, there are reports. for instance,
> > http://marc.info/?l=linux-kernel&m=146823278316663
> 
> That's about backporting a fix from upstream to 3.12 to fix the
> particular issue, so it seems to be solved for the reporter as far as
> it goes.

but there is no upstream fix. if the one you are talking about is
'5874af2003b1 ("printk: enable interrupts before callin console_trylock_for_printk()")'

then it can't and won't solve every single problem with printk.
we still have cases like:

spin_lock()
 printk() -> console_unlock()
spin_unlock()

spin_lock_irqsafe()
 printk() -> console_unlock()
spin_unlock_irqrestore()

rcu_read_lock()
 printk() -> cosnole_unlock()
rcu_read_unlock()

preempt_disable()
 printk() -> console_unlock()
preempt_enable()

local_irq_save()
 printk() -> console_unlock()
local_irq_restore()

in IRQ
printk() -> console_unlock()

in IRQ (again)
printk_deferred() -> irq_work -> IRQ -> wake_up_klogd_work_func -> console_unlock()

and so on.

console_unlock() does
{
 for (;;) {
   text = get_message_from_log_buf();
   call_console_drivers(text) -> UART_write(text);     // for instance
 }
}

while other CPUs on the system do

printk(text)
{
   append_message_to_log_buf(text);
   return;
}


so aync printk attempts to address those problems. what it does
not address, though, are direct console_lock() calls. a driver
or an IRQ handler still can do

	if (console_trylock())
		console_unlock();     -> loop

that is scheduled to be addressed in the future.


> > I do have same problems with pintk (lockups, stalls, etc.)
> > and even more.
> 
> OK, but given that the bugs are fixed as they're reported, the only
> issue seems to be that some people think the fix is incomplete and
> Andrew is sitting on it because he's unsure if the patches actually
> solve the problem (or even if we have a problem).
> 
> The only comments from him I can find are in Jan's series:
> 
> http://thread.gmane.org/gmane.linux.kernel/1619692
> 
> The concern seems to be "prink is fragile you look to be making it
> differently fragile, how is that of benefit".
>
> So the problem is there's no overriding need driving this and it's
> blocked by "vague concerns" about fragility.  Is there a process
> problem that there's no effective way to move these patches forward
> without finding an overriding need or addressing the concerns?

later comments:
http://marc.info/?l=linux-kernel&m=145981032029352

> The concern seems to be "prink is fragile you look to be making it
> differently fragile, how is that of benefit".

well, yes, more or less, that seems to be the concern. probably,
there is no agreement that the patch set is moving in the right
direction (from implementation POV) in the first place.

> > well, I agree that it doesn't make it impossible to read the logs.
> > how often does it happen... on my laptop sometimes KERN_CONT lines
> > are not always really continuous. so I observe it, in some sense.
> 
> OK, so it's unsightly but not necessarily a problem for reading the
> logs.  Again, this means we have no overriding need to fix it.

well, both agree and disagree. once you have cont lines from, say, 3
CPUs mixed in peculiar ways reading the logs is not so simple any longer.
what may be would help here (if `fixing' cont lines is not an option)
is CPU number attached to every line.

for example, this

[12.2324] 0xffff8888
[12.2324] 0xc3234898
[12.2324] 0x00000002
[12.2324] 0xffff1233
[12.2325] 0x00000113
[12.2325] 0xc3248764

becomes this

[0][12.2324] 0xffff8888
[0][12.2324] 0xc3234898
[1][12.2324] 0x00000002
[2][12.2324] 0xffff1233
[2][12.2325] 0x00000113
[0][12.2325] 0xc3248764

just an idea.

	-ss

  parent reply	other threads:[~2016-07-20  2:08 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19  3:47 [Ksummit-discuss] [TECH TOPIC] asynchronous printk Sergey Senozhatsky
2016-07-19  3:56 ` Viresh Kumar
2016-07-19  6:17 ` Hannes Reinecke
2016-07-19  6:49   ` Josh Triplett
2016-07-19  7:02     ` Hannes Reinecke
2016-07-19  7:11       ` Geert Uytterhoeven
2016-07-20  6:02         ` Jan Kara
2016-07-20 22:54       ` Josh Triplett
2016-07-21  0:46         ` Sergey Senozhatsky
2016-07-21  1:12           ` Josh Triplett
2016-07-19  7:33   ` Sergey Senozhatsky
2016-07-19  7:38     ` Hannes Reinecke
2016-07-19  7:46       ` Sergey Senozhatsky
2016-07-19  8:02         ` Hannes Reinecke
2016-07-19  8:23           ` Sergey Senozhatsky
2016-07-21 10:36           ` David Woodhouse
2016-07-21 12:31             ` Jan Kara
2016-07-28  2:55             ` Steven Rostedt
2016-07-20  6:09       ` Jan Kara
2016-07-19  7:46   ` Christian Borntraeger
2016-07-19  7:53     ` Christian Borntraeger
2016-07-19 13:55       ` Jan Kara
2016-07-28  2:59         ` Steven Rostedt
2016-07-28  4:12           ` Sergey Senozhatsky
2016-07-28 13:02             ` Steven Rostedt
2016-07-20  3:35   ` Wangnan (F)
2016-07-21  1:16     ` Andy Lutomirski
2016-07-21  1:52       ` Wangnan (F)
2016-07-21  5:59       ` Hannes Reinecke
2016-07-21 10:31         ` David Woodhouse
2016-07-21 11:19           ` Josh Triplett
2016-07-21 11:59             ` David Woodhouse
2016-07-21 14:21               ` Josh Triplett
2016-07-21 14:40                 ` David Woodhouse
2016-07-28  3:05                 ` Steven Rostedt
2016-08-02 11:59               ` Petr Mladek
2016-07-21 15:05           ` Andy Lutomirski
2016-07-26 14:40             ` David Woodhouse
2016-07-26 15:44               ` Benjamin Herrenschmidt
2016-07-26 21:00               ` Andy Lutomirski
2016-07-27  0:03                 ` David Woodhouse
2016-07-27  1:16                   ` Sergey Senozhatsky
2016-07-21 10:28       ` David Woodhouse
2016-07-19 14:45 ` James Bottomley
2016-07-19 14:55   ` Sergey Senozhatsky
2016-07-19 17:58     ` James Bottomley
2016-07-19 18:24       ` Viresh Kumar
2016-07-20  2:08       ` Sergey Senozhatsky [this message]
2016-07-20  6:14     ` Jan Kara
2016-09-21  4:41 ` Sergey Senozhatsky
2016-10-31  6:54   ` Sergey Senozhatsky
2016-10-31 13:56     ` Theodore Ts'o
2016-10-31 13:59       ` Jiri Kosina
2016-10-31 14:56       ` [Ksummit-discuss] [TECH TOPIC] printk considered harmful (was: [TECH TOPIC] asynchronous printk) Sergey Senozhatsky
2016-10-31 16:18         ` Theodore Ts'o
2016-10-31 18:21           ` Sergey Senozhatsky
2016-10-31 18:26             ` [Ksummit-discuss] [TECH TOPIC] printk considered harmful Hannes Reinecke
2016-10-31 20:28           ` [Ksummit-discuss] [TECH TOPIC] printk considered harmful (was: [TECH TOPIC] asynchronous printk) Jan Kara
2016-11-01 12:27             ` [Ksummit-discuss] [TECH TOPIC] printk considered harmful Hannes Reinecke
2016-11-01 17:50         ` [Ksummit-discuss] [TECH TOPIC] printk considered harmful (was: [TECH TOPIC] asynchronous printk) Sergey Senozhatsky

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=20160720020827.GA660@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=jkosina@suse.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=tj@kernel.org \
    --cc=viresh.kumar@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.