[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPXgP10pQWHYmi1egdArnbnmq=ATDbVo3GBG-=vHskrgkCH1xA@mail.gmail.com>
Date: Mon, 2 Jul 2012 23:00:41 +0200
From: Kay Sievers <kay@...y.org>
To: "Liu, Chuansheng" <chuansheng.liu@...el.com>
Cc: "'linux-kernel@...r.kernel.org' (linux-kernel@...r.kernel.org)"
<linux-kernel@...r.kernel.org>,
"a.p.zijlstra@...llo.nl" <a.p.zijlstra@...llo.nl>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"mingo@...e.hu" <mingo@...e.hu>
Subject: Re: [PATCH] printk: replacing the raw_spin_lock/unlock with raw_spin_lock_irqsave/irqrestore
On Mon, Jul 2, 2012 at 12:36 PM, Liu, Chuansheng
<chuansheng.liu@...el.com> wrote:
> From: liu chuansheng <chuansheng.liu@...el.com>
> Subject: [PATCH] printk: replacing the raw_spin_lock/unlock with raw_spin_lock_irqsave/irqrestore
>
> In function devkmsg_read/writev/llseek/poll/open()..., the function
> raw_spin_lock/unlock is used, there is potential deadlock case happening.
> CPU1: thread1 doing the cat /dev/kmsg:
> raw_spin_lock(&logbuf_lock);
> while (user->seq == log_next_seq) {
> when thread1 run here, at this time one interrupt is coming on CPU1 and running
> based on this thread,if the interrupt handle called the printk which need the
> logbuf_lock spin also, it will cause deadlock.
>
> So we should use raw_spin_lock_irq_save/irqrestore here.
They are all handling a system call, isn't raw_spin_lock_irq() without
the flag restoration good enough then?
Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists