This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH -mm] relayfs: support larger relay buffer
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Pekka Enberg <penberg at cs dot helsinki dot fi>
- Cc: David Wilder <dwilder at us dot ibm dot com>, Tom Zanussi <zanussi at comcast dot net>, Andrew Morton <akpm at linux-foundation dot org>, systemtap-ml <systemtap at sources dot redhat dot com>, LKML <linux-kernel at vger dot kernel dot org>
- Date: Wed, 16 Apr 2008 10:36:46 -0400
- Subject: Re: [PATCH -mm] relayfs: support larger relay buffer
- References: <4804C95F.2080204@redhat.com> <84144f020804160133ye2327b8wb3774e1e0ccf6ff8@mail.gmail.com>
Hi Pekka,
Pekka Enberg wrote:
> On Tue, Apr 15, 2008 at 6:27 PM, Masami Hiramatsu <mhiramat@redhat.com> wrote:
>> Use vmalloc() and memset() instead of kcalloc() to allocate a page* array
>> when the array size is bigger than one page. This enables relayfs to support
>> bigger relay buffers than 64MB on 4k-page system, 512MB on 16k-page system.
>>
>> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
>> ---
>> @@ -130,7 +138,10 @@ static void *relay_alloc_buf(struct rcha
>> depopulate:
>> for (j = 0; j < i; j++)
>> __free_page(buf->page_array[j]);
>> - kfree(buf->page_array);
>> + if (pa_size > PAGE_SIZE)
>
> You can use is_vmalloc_addr() here.
Thank you for your good advice!
I'll use that.
>
>> + vfree(buf->page_array);
>> + else
>> + kfree(buf->page_array);
>> return NULL;
>> }
>>
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com