Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155347
b: refs/heads/master
c: 288c857
h: refs/heads/master
i:
  155345: 83e8089
  155343: 0089aae
v: v3
  • Loading branch information
Catalin Marinas committed Jul 8, 2009
1 parent 7165c42 commit 153d720
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b8a96744c0c27ab94fb4e8155d4384c3b399e27
refs/heads/master: 288c857d66a400ca4846dd700eb1c4820d738bb9
17 changes: 2 additions & 15 deletions trunk/mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
* Kmemleak configuration and common defines.
*/
#define MAX_TRACE 16 /* stack trace length */
#define REPORTS_NR 50 /* maximum number of reported leaks */
#define MSECS_MIN_AGE 5000 /* minimum object age for reporting */
#define SECS_FIRST_SCAN 60 /* delay before the first scan */
#define SECS_SCAN_WAIT 600 /* subsequent auto scanning delay */
Expand Down Expand Up @@ -196,9 +195,6 @@ static int kmemleak_stack_scan = 1;
/* protects the memory scanning, parameters and debug/kmemleak file access */
static DEFINE_MUTEX(scan_mutex);

/* number of leaks reported (for limitation purposes) */
static int reported_leaks;

/*
* Early object allocation/freeing logging. Kmemleak is initialized after the
* kernel allocator. However, both the kernel allocator and kmemleak may
Expand Down Expand Up @@ -1106,11 +1102,6 @@ static void *kmemleak_seq_start(struct seq_file *seq, loff_t *pos)
struct kmemleak_object *object;
loff_t n = *pos;

if (!n)
reported_leaks = 0;
if (reported_leaks >= REPORTS_NR)
return NULL;

rcu_read_lock();
list_for_each_entry_rcu(object, &object_list, object_list) {
if (n-- > 0)
Expand All @@ -1135,8 +1126,6 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct list_head *n = &prev_obj->object_list;

++(*pos);
if (reported_leaks >= REPORTS_NR)
goto out;

rcu_read_lock();
list_for_each_continue_rcu(n, &object_list) {
Expand All @@ -1145,7 +1134,7 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
break;
}
rcu_read_unlock();
out:

put_object(prev_obj);
return next_obj;
}
Expand All @@ -1168,10 +1157,8 @@ static int kmemleak_seq_show(struct seq_file *seq, void *v)
unsigned long flags;

spin_lock_irqsave(&object->lock, flags);
if ((object->flags & OBJECT_REPORTED) && unreferenced_object(object)) {
if ((object->flags & OBJECT_REPORTED) && unreferenced_object(object))
print_unreferenced(seq, object);
reported_leaks++;
}
spin_unlock_irqrestore(&object->lock, flags);
return 0;
}
Expand Down

0 comments on commit 153d720

Please sign in to comment.