diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2011-09-25 04:50:23 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-09-25 20:46:20 -0400 |
commit | f9732ea145886786a6f8b0493bc2239e70cbacdb (patch) | |
tree | e29b2441cc916a174d7cd0b03cd18986ae545250 /security/tomoyo/condition.c | |
parent | 778c4a4d60d932c1df6d270dcbc88365823c3963 (diff) |
TOMOYO: Simplify garbage collector.
When TOMOYO started using garbage collector at commit 847b173e "TOMOYO: Add
garbage collector.", we waited for close() before kfree(). Thus, elements to be
kfree()d were queued up using tomoyo_gc_list list.
But it turned out that tomoyo_element_linked_by_gc() tends to choke garbage
collector when certain pattern of entries are queued.
Since garbage collector is no longer waiting for close() since commit 2e503bbb
"TOMOYO: Fix lockdep warning.", we can remove tomoyo_gc_list list and
tomoyo_element_linked_by_gc() by doing sequential processing.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/condition.c')
-rw-r--r-- | security/tomoyo/condition.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/security/tomoyo/condition.c b/security/tomoyo/condition.c index b854959c0fd4..986330b8c73e 100644 --- a/security/tomoyo/condition.c +++ b/security/tomoyo/condition.c | |||
@@ -400,8 +400,9 @@ static struct tomoyo_condition *tomoyo_commit_condition | |||
400 | found = true; | 400 | found = true; |
401 | goto out; | 401 | goto out; |
402 | } | 402 | } |
403 | list_for_each_entry_rcu(ptr, &tomoyo_condition_list, head.list) { | 403 | list_for_each_entry(ptr, &tomoyo_condition_list, head.list) { |
404 | if (!tomoyo_same_condition(ptr, entry)) | 404 | if (!tomoyo_same_condition(ptr, entry) || |
405 | atomic_read(&ptr->head.users) == TOMOYO_GC_IN_PROGRESS) | ||
405 | continue; | 406 | continue; |
406 | /* Same entry found. Share this entry. */ | 407 | /* Same entry found. Share this entry. */ |
407 | atomic_inc(&ptr->head.users); | 408 | atomic_inc(&ptr->head.users); |
@@ -411,8 +412,7 @@ static struct tomoyo_condition *tomoyo_commit_condition | |||
411 | if (!found) { | 412 | if (!found) { |
412 | if (tomoyo_memory_ok(entry)) { | 413 | if (tomoyo_memory_ok(entry)) { |
413 | atomic_set(&entry->head.users, 1); | 414 | atomic_set(&entry->head.users, 1); |
414 | list_add_rcu(&entry->head.list, | 415 | list_add(&entry->head.list, &tomoyo_condition_list); |
415 | &tomoyo_condition_list); | ||
416 | } else { | 416 | } else { |
417 | found = true; | 417 | found = true; |
418 | ptr = NULL; | 418 | ptr = NULL; |