Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d7ee5605
Commit
d7ee5605
authored
Jun 27, 2008
by
Ingo Molnar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'core/debugobjects' into core/urgent
parents
1b7558e4
50db04dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
lib/debugobjects.c
lib/debugobjects.c
+6
-9
No files found.
lib/debugobjects.c
View file @
d7ee5605
...
@@ -68,6 +68,7 @@ static int fill_pool(void)
...
@@ -68,6 +68,7 @@ static int fill_pool(void)
{
{
gfp_t
gfp
=
GFP_ATOMIC
|
__GFP_NORETRY
|
__GFP_NOWARN
;
gfp_t
gfp
=
GFP_ATOMIC
|
__GFP_NORETRY
|
__GFP_NOWARN
;
struct
debug_obj
*
new
;
struct
debug_obj
*
new
;
unsigned
long
flags
;
if
(
likely
(
obj_pool_free
>=
ODEBUG_POOL_MIN_LEVEL
))
if
(
likely
(
obj_pool_free
>=
ODEBUG_POOL_MIN_LEVEL
))
return
obj_pool_free
;
return
obj_pool_free
;
...
@@ -81,10 +82,10 @@ static int fill_pool(void)
...
@@ -81,10 +82,10 @@ static int fill_pool(void)
if
(
!
new
)
if
(
!
new
)
return
obj_pool_free
;
return
obj_pool_free
;
spin_lock
(
&
pool_lock
);
spin_lock
_irqsave
(
&
pool_lock
,
flags
);
hlist_add_head
(
&
new
->
node
,
&
obj_pool
);
hlist_add_head
(
&
new
->
node
,
&
obj_pool
);
obj_pool_free
++
;
obj_pool_free
++
;
spin_unlock
(
&
pool_lock
);
spin_unlock
_irqrestore
(
&
pool_lock
,
flags
);
}
}
return
obj_pool_free
;
return
obj_pool_free
;
}
}
...
@@ -110,16 +111,13 @@ static struct debug_obj *lookup_object(void *addr, struct debug_bucket *b)
...
@@ -110,16 +111,13 @@ static struct debug_obj *lookup_object(void *addr, struct debug_bucket *b)
}
}
/*
/*
* Allocate a new object. If the pool is empty and no refill possible,
* Allocate a new object. If the pool is empty, switch off the debugger.
* switch off the debugger.
*/
*/
static
struct
debug_obj
*
static
struct
debug_obj
*
alloc_object
(
void
*
addr
,
struct
debug_bucket
*
b
,
struct
debug_obj_descr
*
descr
)
alloc_object
(
void
*
addr
,
struct
debug_bucket
*
b
,
struct
debug_obj_descr
*
descr
)
{
{
struct
debug_obj
*
obj
=
NULL
;
struct
debug_obj
*
obj
=
NULL
;
int
retry
=
0
;
repeat:
spin_lock
(
&
pool_lock
);
spin_lock
(
&
pool_lock
);
if
(
obj_pool
.
first
)
{
if
(
obj_pool
.
first
)
{
obj
=
hlist_entry
(
obj_pool
.
first
,
typeof
(
*
obj
),
node
);
obj
=
hlist_entry
(
obj_pool
.
first
,
typeof
(
*
obj
),
node
);
...
@@ -141,9 +139,6 @@ alloc_object(void *addr, struct debug_bucket *b, struct debug_obj_descr *descr)
...
@@ -141,9 +139,6 @@ alloc_object(void *addr, struct debug_bucket *b, struct debug_obj_descr *descr)
}
}
spin_unlock
(
&
pool_lock
);
spin_unlock
(
&
pool_lock
);
if
(
fill_pool
()
&&
!
obj
&&
!
retry
++
)
goto
repeat
;
return
obj
;
return
obj
;
}
}
...
@@ -261,6 +256,8 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack)
...
@@ -261,6 +256,8 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack)
struct
debug_obj
*
obj
;
struct
debug_obj
*
obj
;
unsigned
long
flags
;
unsigned
long
flags
;
fill_pool
();
db
=
get_bucket
((
unsigned
long
)
addr
);
db
=
get_bucket
((
unsigned
long
)
addr
);
spin_lock_irqsave
(
&
db
->
lock
,
flags
);
spin_lock_irqsave
(
&
db
->
lock
,
flags
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment