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: "Pekka Enberg" <penberg at cs dot helsinki dot fi>
- To: "Masami Hiramatsu" <mhiramat at redhat dot com>
- 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 11:33:01 +0300
- Subject: Re: [PATCH -mm] relayfs: support larger relay buffer
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=UNe4RBBfg4FuMgbfHm8xzuY7OxqPnnTtxSKFA8n2u2g=; b=u99y6W96qOlp88hNqfPS+UlhmR2rFFpa0AYFgnMBn8UdwIpT+4PyJG8AQP43NRFsCisRiSZauTaGUyFCsFsyBwap83rnnAL6+3gtYHTNH4hcdmABFkktV2a8lCi80SSKF7mNzJmZyvz/YXA94VC9Rvl1uXEQLmm6AtULENXVXuo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=VWFCLl344XoXPYYqLtPh8ccyNwoEREgqlgHK9FigYOfq3cVaUECOcB1/oSp5jBO9rAX2B18kGHBa8kD/7eZBUncUZDfPWfPDKaaJlnTow2pyF3oE8grnlHhU5+oXcKjQxnEge6MVF7Gp4rkRpMhxIbD/VR4336ZIXVR9fRYyrZg=
- References: <4804C95F.2080204@redhat.com>
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.
> + vfree(buf->page_array);
> + else
> + kfree(buf->page_array);
> return NULL;
> }
>