From: ierdnah <ierdnah@go.ro>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: kernel oops!
Date: Fri, 28 Jan 2005 22:00:01 +0200 [thread overview]
Message-ID: <1106942401.27217.8.camel@ierdnac> (raw)
In-Reply-To: <Pine.LNX.4.58.0501271532420.2362@ppc970.osdl.org>
On Thu, 2005-01-27 at 15:35 -0800, Linus Torvalds wrote:
the last patch works, but the load increases very much (normally with
200 VPN connections I have a load of maximum 10, with this patch I have
a load of 50-100 - after 30 min of uptime)
> You probably should. The patch you've tested is really ugly, and not a fix
> at all - it's really just depending on the compiler generating a specific
> code sequence that will hide the race. As such, it's a patch I would only
> accept in the standard kernel as an absolute last resort.
>
> In contrast, the second patch I tested may actually _fix_ the race.
>
> The fact that the first patch makes the oops go away is a good thing,
> though: it shows that your oops really was due to that small race window,
> and as such it helps validate that it wasn't anything else.
--- 1.32/drivers/char/pty.c 2005-01-10 17:29:36 -08:00
+++ edited/drivers/char/pty.c 2005-01-23 10:21:04 -08:00
@@ -149,13 +149,17 @@
static int pty_chars_in_buffer(struct tty_struct *tty)
{
struct tty_struct *to = tty->link;
- int count;
+ int count = 0;
- if (!to || !to->ldisc.chars_in_buffer)
- return 0;
-
- /* The ldisc must report 0 if no characters available to be read
*/
- count = to->ldisc.chars_in_buffer(to);
+ if (to) {
+ struct tty_ldisc *ld = tty_ldisc_ref(to);
+ if (ld) {
+ if (ld->chars_in_buffer) {
+ count = ld->chars_in_buffer(to);
+ tty_ldisc_deref(ld);
+ }
+ }
+ }
if (tty->driver->subtype == PTY_TYPE_SLAVE) return count;
--
ierdnah <ierdnah@go.ro>
next prev parent reply other threads:[~2005-01-28 20:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-22 23:36 kernel oops! ierdnah
2005-01-23 6:43 ` Linus Torvalds
2005-01-23 12:29 ` ierdnah
2005-01-23 17:51 ` Linus Torvalds
2005-01-24 19:21 ` ierdnah
2005-01-27 22:47 ` ierdnah
2005-01-27 23:35 ` Linus Torvalds
2005-01-28 20:00 ` ierdnah [this message]
2005-01-28 20:28 ` Linus Torvalds
2005-01-28 22:22 ` ierdnah
2005-01-23 13:15 ` Sergey Vlasov
2005-01-23 18:22 ` Linus Torvalds
2005-01-24 15:44 ` Alan Cox
2005-01-24 17:58 ` Linus Torvalds
2005-01-24 18:09 ` Alan Cox
2005-01-24 15:44 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2008-01-07 23:15 Kernel Oops? Stoyan Gaydarov
2008-01-07 23:30 ` Alan Cox
2008-01-09 2:25 ` Stoyan Gaydarov
2008-01-09 3:02 ` Alan Cox
2008-01-09 3:24 ` Stoyan Gaydarov
2008-01-10 23:05 ` Jesper Juhl
2008-01-07 23:34 ` Jesper Juhl
2004-09-17 14:05 kernel Oops!!!! Jysuis Parla
2004-09-17 14:05 Jysuis Parla
2004-09-17 17:30 ` Gene Heskett
[not found] <3A08FA77.703BCC07@rdstm.ro>
2000-11-08 16:29 ` Kernel oops! Venky
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=1106942401.27217.8.camel@ierdnac \
--to=ierdnah@go.ro \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox