The patch titled relayfs: support larger relay buffer has been added to the -mm tree. Its filename is relayfs-support-larger-relay-buffer.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: relayfs: support larger relay buffer From: Masami Hiramatsu <mhiramat@xxxxxxxxxx> 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. This is useful for a 64-bit system which has a plenty of memory (tens of giga bytes) and a large kernel memory space. Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx> Cc: David Wilder <dwilder@xxxxxxxxxx> Cc: Tom Zanussi <zanussi@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/relay.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff -puN kernel/relay.c~relayfs-support-larger-relay-buffer kernel/relay.c --- a/kernel/relay.c~relayfs-support-larger-relay-buffer +++ a/kernel/relay.c @@ -104,12 +104,20 @@ static int relay_mmap_buf(struct rchan_b static void *relay_alloc_buf(struct rchan_buf *buf, size_t *size) { void *mem; - unsigned int i, j, n_pages; + unsigned int i, j, n_pages, pa_size; *size = PAGE_ALIGN(*size); n_pages = *size >> PAGE_SHIFT; + pa_size = n_pages * sizeof(struct page *); - buf->page_array = kcalloc(n_pages, sizeof(struct page *), GFP_KERNEL); + if (pa_size > PAGE_SIZE) { + buf->page_array = vmalloc(pa_size); + if (buf->page_array) + memset(buf->page_array, 0, pa_size); + } else { + buf->page_array = kcalloc(n_pages, sizeof(struct page *), + GFP_KERNEL); + } if (!buf->page_array) return NULL; @@ -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) + vfree(buf->page_array); + else + kfree(buf->page_array); return NULL; } @@ -189,7 +200,10 @@ static void relay_destroy_buf(struct rch vunmap(buf->start); for (i = 0; i < buf->page_count; i++) __free_page(buf->page_array[i]); - kfree(buf->page_array); + if (buf->page_count * sizeof(struct page *) > PAGE_SIZE) + vfree(buf->page_array); + else + kfree(buf->page_array); } chan->buf[buf->cpu] = NULL; kfree(buf->padding); _ Patches currently in -mm which might be from mhiramat@xxxxxxxxxx are git-x86.patch git-ia64.patch listh-add-list_singleton.patch listh-add-list_singleton-fix.patch kprobes-add-unregister_kprobes-for-batch-registration.patch kprobes-add-unregister_kprobes-for-batch-registration-fix.patch kprobes-add-unregister_kretprobes-for-batch-registration.patch kprobes-add-unregister_jprobes-for-batch-registration.patch kprobes-update-document-about-batch-registration.patch relayfs-support-larger-relay-buffer.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html