[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4EB7D0A4.405@ilyx.ru>
Date: Mon, 07 Nov 2011 16:35:48 +0400
From: Ilya Zykov <ilya@...x.ru>
To: Alan Cox <alan@...ux.intel.com>
CC: Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org,
Ilya Zykov <ilya@...x.ru>
Subject: Re: PROBLEM: Race condition in tty buffer's function flush_to_ldisc().
Alan Cox wrote:
> On Mon, 07 Nov 2011 15:14:34 +0400
> Ilya Zykov <ilya@...x.ru> wrote:
>
>> Function flush_to_ldisc() call disc->ops->receive_buf(),
>> without tty->buf.lock and with TTY_FLUSHING bit set.
>
> flush_to_ldisc is single threaded for a given tty. If you fail to
> ensure that is the case everything breaks.
Why we need: "if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) {"
if flush_to_ldisc is single threaded?
we can: set_bit(TTY_FLUSHING, &tty->flags)
without if() at all.
>
> What cases does this occur ?
>
> Also for the other patches do you have benchmarks yet ?
>
> Alan
>
--
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