[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100213000923.03007ddf@lxorguk.ukuu.org.uk>
Date: Sat, 13 Feb 2010 00:09:23 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Henry Nestler <henry-20071123@...or.de>
Cc: linux-kernel@...r.kernel.org,
"Frédéric L. W. Meunier" <fredlwm@...il.com>,
gregkh@...e.de, Simon.Richter@...bos.fachschaften.tu-muenchen.de
Subject: Re: [2.6.33-rc7] tty: page allocation failure (from
tty_buffer_request_room)
> > You are doing some output on console, for example write to a device /dev/tty.
> > Inside tty_buffer_request_room I found, that kmalloc was called and interrupts
> > are disabled. That means, memory can not swap out - if no free page is
> > available. tty_buffer_request_room checks for NULL returns. So, it assumes,
> > that kmalloc can fail. Unless they have forgotten to set __GFP_NOWARN. - Or it
> > is a defective design, and kmalloc should not called inside a spin_lock.
Neither - if we can't allocate a small buffer (and I would expect this to
be a small buffer of under one page) then we lose data and while we
continue to run it indicates a very serious low memory condition that the
user really ought to be aware of.
If anything what this says is that tty_insert_flip_string and friends
ought to be tweaked to do
nt tty_insert_flip_string(struct tty_struct *tty, const unsigned char
*chars, size_t size)
{
int copied = 0;
do {
int want = min(size - copied, TTY_BUFFER_PAGE);
int space = tty_buffer_request_room(tty, want);
...
where TTY_BUFFER_PAGE is defined to be the size to request so the buffer
will fit in one page of memory.
--
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