lkml.org 
[lkml]   [2012]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kmsg: Use vmalloc instead of kmalloc when writing
On Sat, Mar 31, 2012 at 2:02 AM, Kay Sievers <kay@vrfy.org> wrote:
> On Sat, Mar 31, 2012 at 01:43, Greg KH <gregkh@linuxfoundation.org> wrote:
>> On Sat, Mar 31, 2012 at 12:02:39AM +0200, Sasha Levin wrote:
>>> On Fri, Mar 30, 2012 at 11:17 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>> > On Fri, Mar 30, 2012 at 09:05:52PM +0000, Arnd Bergmann wrote:
>>> >> On Friday 30 March 2012, Thomas Gleixner wrote:
>>> >> > I think so. This is an interface to inject stuff into dmesg. Limiting
>>> >> > that to a reasonable size makes sense. We can probably limit it to
>>> >> > something small like 1024, but I don't know about the "ideas" of those
>>> >> > folks who think that it's a great idea to do it at all.
>>> >>
>>> >> I guess a page would be a reasonable size, similar to what we do for
>>> >> sysfs.
>>> >
>>> > Ok. Sasha, as you seem to have noticed this, care to dig in syslog and
>>> > systemd to get an idea of the buffer sizes they are expecting to pass
>>> > into kmsg, and if they can handle a short write properly?  If so,
>>> > restricting it to a page is fine with me, otherwise we might want to
>>> > make it a bit bigger.
>>>
>>> systemd seems to use posix LINE_MAX sized buffers, syslog-ng uses
>>> dynamic strings, but it chews them one line at the time.
>>
>> Ok, care to update this patch with a max size?
>>
>> And again, does systemd and syslog-ng handle short writes properly?
>
> Printk has a static scratch buffer of 1024, we can not really process
> more than that, so we can limit the /dev/kmsg write() to the same
> size, I guess.

That's odd. I've tested it by writing 8000 chars into /dev/kmsg, and
all of them came out on the printk, and I saw all of them in my dmesg.

This means that while printk may be somehow limited to 1024, it's
still possible to dump more than that into dmesg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-03-31 11:01    [W:0.075 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site