Re: [patch 03/20] x86, ptrace, bts: defer branch trace stopping

From: Peter Zijlstra
Date: Fri Apr 03 2009 - 11:00:30 EST


On Fri, 2009-04-03 at 16:43 +0200, markus.t.metzger@xxxxxxxxx wrote:
> Index: b/include/linux/mm.h
> ===================================================================
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -13,6 +13,7 @@
> #include <linux/prio_tree.h>
> #include <linux/debug_locks.h>
> #include <linux/mm_types.h>
> +#include <linux/sched.h>

Why do we need that new include?

> struct mempolicy;
> struct anon_vma;
> @@ -1318,6 +1319,6 @@ void vmemmap_populate_print_last(void);
>
> extern void *alloc_locked_buffer(size_t size);
> extern void free_locked_buffer(void *buffer, size_t size);
> -extern void release_locked_buffer(void *buffer, size_t size);
> +extern void refund_locked_buffer_memory(struct mm_struct *mm, size_t size);

that's a pointer to a struct, so it doesn't need a fully qualified type.

Also, I can't say I like the name, what about something like:

void account_locked_buffer(struct mm_struct *mm, long pages)
{
down_write(&mm->mmap_sem);

mm->total_vm += pages;
mm->locked_vm += pages;

up_write(&mm->mmap_sem);
}

but looking more closely at that alloc_locked_buffer() stuff, I really
hate it, who in his right mind does a multi-page kmalloc() -- that's
crazy.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/