All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Byungchul Park <byungchul.park@lge.com>
Cc: akpm@linux-foundation.org, mingo@kernel.org,
	linux-kernel@vger.kernel.org, akinobu.mita@gmail.com,
	jack@suse.cz, sergey.senozhatsky.work@gmail.com,
	peter@hurleysoftware.com, tglx@linutronix.de,
	peterz@infradead.org, rostedt@goodmis.org
Subject: Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock
Date: Mon, 14 Mar 2016 10:37:52 +0900	[thread overview]
Message-ID: <20160314013752.GB8074@swordfish> (raw)
In-Reply-To: <1457692627-14076-3-git-send-email-byungchul.park@lge.com>

On (03/11/16 19:37), Byungchul Park wrote:
[..]
> +static void __spin_dump_deferred(raw_spinlock_t *lock, const char *msg)
> +{
> +	printk_func_t s;
> +
> +	s = this_cpu_read(printk_func);
> +	this_cpu_write(printk_func, vprintk_deferred);
> +
> +	/*
> +	 * To change printk_func, it must be in preempt disabled and irq
> +	 * disabled. WARN_ON() should be called after the change because
> +	 * the default printk_func which may be called from WARN_ON()
> +	 * is prohibited in this context.
> +	 */
> +	WARN_ON(!preempt_count() || !irqs_disabled());
> +	__spin_dump(lock, msg);
> +
> +	this_cpu_write(printk_func, s);
> +
> +	printk_pending_output();
> +}
>
> +static void spin_dump(raw_spinlock_t *lock, const char *msg)
> +{
> +	if (unlikely(console_sem_spin_is_held()))
> +		__spin_dump_deferred(lock, msg);
> +	else
> +		__spin_dump(lock, msg);
> +}

so can it be

vprintk_emit()
 __spin_dump_deferred()
  vprintk_deferred()
   vprintk_emit()
    __spin_dump_deferred()
     vprintk_deferred()


or am I getting it wrong?

	-ss

  reply	other threads:[~2016-03-14  1:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 10:37 [PATCH v6 0/2] Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park
2016-03-11 10:37 ` [PATCH v6 1/2] printk: Factor out buffering and irq work queuing in printk_deferred Byungchul Park
2016-03-14  1:21   ` Sergey Senozhatsky
2016-03-14  4:45     ` Byungchul Park
2016-03-11 10:37 ` [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park
2016-03-14  1:37   ` Sergey Senozhatsky [this message]
2016-03-14  2:30     ` Byungchul Park
2016-03-14  2:40       ` Sergey Senozhatsky
2016-03-14  4:17         ` Byungchul Park
2016-03-16  2:06           ` Byungchul Park
2016-03-18  5:55 ` [PATCH] lib/spinlock_debug: Prevent a unnecessary recursive spin_dump() Byungchul Park

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=20160314013752.GB8074@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=byungchul.park@lge.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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.