lkml.org 
[lkml]   [2006]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kmap tracking
Randy.Dunlap wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
>
> Track kmap/kunmap call history, storing caller function address,
> action, and time (jiffies), if CONFIG_DEBUG_KMAP is enabled.
> Based on a patch to 2.4.21 by Zach Brown that was used successfully
> at Oracle to track down some kmap/kunmap problems.

Thanks for bringing this to 2.6.. sorry for the lag in reviewing.

> +enum {
> + KMAP_FIRST = 1,
> + KMAP_ADDREF,
> + KMAP_DECREF,
> + KMAP_LAST,
> +};

I trust you got rid of these in the most recent version :)

> +#else
> +#define kmap_record_action(nr, action, refcount, retaddr) do {} while (0)
> +#endif

Make this an inline, please, so that we don't introduce unused var warnings.

> +static __init int kmap_history_init(void)
> +{
> + kmap_history_file = debugfs_create_file("kmap-history", 0644, NULL,
> + kh_running, &kmap_running_seq_fops);
> + if (!kmap_history_file)
> + goto out1;
> +
> + return 0;
> +
> +out1:
> + return -ENOMEM;

That seems noisy.. return -ENOMEM is probably fine for such a trivial
funciton :).

> +#define kmap(page) __kmap(page, __builtin_return_address(0))
> +#define kunmap(page) __kunmap(page, __builtin_return_address(0))

Hmm, I was hoping we wouldn't have to do this. Can we use
__builtin_return_address(1) from within the debug paths instead of
passing down (0)? Then we wouldn't have to ifdef around the declarations..

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

\
 
 \ /
  Last update: 2006-05-22 18:45    [W:3.538 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site