Another desparate hack to try and prevent the oops.

Fri May  6 23:38:48 2005  Søren Sandmann  <sandmann@redhat.com>

	* sysprof-module.c (do_generate): Another desparate hack to try
	and prevent the oops.
This commit is contained in:
Søren Sandmann
2005-05-07 14:59:45 +00:00
committed by Søren Sandmann Pedersen
parent 6906804784
commit 582efc99b2
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Fri May 6 23:38:48 2005 Søren Sandmann <sandmann@redhat.com>
* sysprof-module.c (do_generate): Another desparate hack to try
and prevent the oops.
Sat Apr 30 16:57:23 2005 Soeren Sandmann <sandmann@redhat.com>
* process.c (PAGE_SIZE): Use getpagesize()

View File

@ -335,9 +335,17 @@ do_generate (void *data)
if (head++ == &stack_traces[N_TRACES - 1])
head = &stack_traces[0];
wake_up (&wait_for_trace);
/* This is crack, what we actually want is "put_task_struct()",
* but that macros uses __put_task_struct() which is not exported.
*
* It does look to me like the worst that will happen is a rare
* leak, which is certainly better than an oops.
*/
if (atomic_dec_and_test(&(task)->usage)) {
free_task (task);
}
mod_timer(&timer, jiffies + INTERVAL);
}
@ -348,7 +356,7 @@ on_timer(unsigned long dong)
{
if (current && current->state == TASK_RUNNING && current->pid != 0)
{
set_current_state (TASK_UNINTERRUPTIBLE);
get_task_struct (current);
INIT_WORK (&work, do_generate, current);