lkml.org 
[lkml]   [2013]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] kernel/rcutorture.c: be sure of enough memory for result printing
On 11/08/2013 04:59 AM, Paul E. McKenney wrote:
> On Thu, Nov 07, 2013 at 10:30:25AM +0800, Chen Gang wrote:
>> > If the contents is more than 4096 bytes (e.g. if have 1K cpus), current
>> > sprintf() will cause memory overflow. And this fix patch is to be sure
>> > of memory large enough.
>> >
>> > Benefit:
>> >
>> > - do not truncate printing contents.
>> > - extensible, it is large enough for printing various related contents.
>> > - simple and clear enough for both source code readers and writers.
>> >
>> > Shortcoming:
>> >
>> > - It will waste some memory:
>> >
>> > 1 cpu now comsumes 50 - 60 bytes, and this patch provides 200 bytes.
>> > global printing now comsumes a few KB, and this patch provide 8KB,
>> > so for 1K cpus, it may waste 100 - 200 KB memory.
>> >
>> > after finish printing, it will free the related memory, quickly.
>> > it is a test module, so wast a little memory for extensible is OK.
>> >
>> > Related test (Fedora16 2 CPUs, 2GB RAM x86_64)
>> >
>> > - as module, with/without "torture_type=srcu".
>> > - build-in not boot runnable, with/without "torture_type=srcu".
>> > - build-in let boot runnable, with/without "torture_type=srcu".
>> >
>> >
>> > Signed-off-by: Chen Gang <gang.chen@asianux.com>
> Thank you, queued for 3.14.

Thank you too.

--
Chen Gang


\
 
 \ /
  Last update: 2013-11-08 02:21    [W:0.452 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site