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


Groups > linux.kernel > #1356805

Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock
Date 2016-03-14 02:40 +0100
Message-ID <rcpEe-5dH-1@gated-at.bofh.it> (permalink)
References <rbsE9-4Ih-13@gated-at.bofh.it> <rbsE9-4Ih-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

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


Thread

[PATCH v6 0/2] Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-11 11:40 +0100
  [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-11 11:40 +0100
    Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to  avoid a deadlock Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-14 02:40 +0100
      Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to  avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-14 03:40 +0100
        Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to  avoid a deadlock Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-14 03:40 +0100
          Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to  avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-14 05:20 +0100
            Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to  avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-16 03:10 +0100
  [PATCH v6 1/2] printk: Factor out buffering and irq work queuing in printk_deferred Byungchul Park <byungchul.park@lge.com> - 2016-03-11 11:40 +0100
    Re: [PATCH v6 1/2] printk: Factor out buffering and irq work queuing  in printk_deferred Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-14 02:30 +0100
      Re: [PATCH v6 1/2] printk: Factor out buffering and irq work queuing  in printk_deferred Byungchul Park <byungchul.park@lge.com> - 2016-03-14 05:50 +0100

csiph-web