Konstantin Khlebnikov
15cf17d26e
memcg: initialize kmem-cache destroying work earlier
...
Fix a warning from lockdep caused by calling cancel_work_sync() for
uninitialized struct work. This path has been triggered by destructon
kmem-cache hierarchy via destroying its root kmem-cache.
cache ffff88003c072d80
obj ffff88003b410000 cache ffff88003c072d80
obj ffff88003b924000 cache ffff88003c20bd40
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
Pid: 2825, comm: insmod Tainted: G O 3.9.0-rc1-next-20130307+ #611
Call Trace:
__lock_acquire+0x16a2/0x1cb0
lock_acquire+0x8a/0x120
flush_work+0x38/0x2a0
__cancel_work_timer+0x89/0xf0
cancel_work_sync+0xb/0x10
kmem_cache_destroy_memcg_children+0x81/0xb0
kmem_cache_destroy+0xf/0xe0
init_module+0xcb/0x1000 [kmem_test]
do_one_initcall+0x11a/0x170
load_module+0x19b0/0x2320
SyS_init_module+0xc6/0xf0
system_call_fastpath+0x16/0x1b
Example module to demonstrate:
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/workqueue.h>
int __init mod_init(void)
{
int size = 256;
struct kmem_cache *cache;
void *obj;
struct page *page;
cache = kmem_cache_create("kmem_cache_test", size, size, 0, NULL);
if (!cache)
return -ENOMEM;
printk("cache %p\n", cache);
obj = kmem_cache_alloc(cache, GFP_KERNEL);
if (obj) {
page = virt_to_head_page(obj);
printk("obj %p cache %p\n", obj, page->slab_cache);
kmem_cache_free(cache, obj);
}
flush_scheduled_work();
obj = kmem_cache_alloc(cache, GFP_KERNEL);
if (obj) {
page = virt_to_head_page(obj);
printk("obj %p cache %p\n", obj, page->slab_cache);
kmem_cache_free(cache, obj);
}
kmem_cache_destroy(cache);
return -EBUSY;
}
module_init(mod_init);
MODULE_LICENSE("GPL");
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-03-08 15:05:34 -08:00
..
2013-02-21 17:22:19 -08:00
2012-12-11 17:22:26 -08:00
2013-01-29 19:32:59 -08:00
2013-02-21 17:22:20 -08:00
2013-02-26 02:46:10 -05:00
2013-02-23 17:50:20 -08:00
2011-12-06 09:24:07 +01:00
2012-12-11 17:22:24 -08:00
2013-02-26 20:16:07 -08:00
2012-01-03 22:54:56 -05:00
2012-10-09 16:22:58 +09:00
2013-02-26 20:16:07 -08:00
2013-02-23 17:50:11 -08:00
2012-09-21 10:38:12 -04:00
2012-12-20 08:37:05 -08:00
2013-02-27 19:10:24 -08:00
2012-12-18 15:02:15 -08:00
2013-02-26 20:16:07 -08:00
2012-07-31 18:42:43 -07:00
2011-07-26 16:49:47 -07:00
2013-02-27 19:10:09 -08:00
2012-10-09 16:22:42 +09:00
2013-02-27 19:10:23 -08:00
2012-01-10 16:30:42 -08:00
2013-02-27 19:10:24 -08:00
2013-03-08 15:05:34 -08:00
2011-10-31 09:20:12 -04:00
2013-02-23 17:50:10 -08:00
2012-12-11 17:22:26 -08:00
2013-03-02 09:34:39 -08:00
2013-03-08 15:05:34 -08:00
2013-02-23 17:50:21 -08:00
2013-02-23 17:50:22 -08:00
2013-02-25 15:41:43 -08:00
2013-03-08 15:05:34 -08:00
2012-06-25 11:53:47 +02:00
2013-02-23 17:50:19 -08:00
2013-02-23 17:50:17 -08:00
2013-02-27 19:10:09 -08:00
2013-02-23 17:50:18 -08:00
2013-02-27 08:36:04 -08:00
2012-03-21 17:54:59 -07:00
2013-02-27 19:10:24 -08:00
2013-02-23 17:50:18 -08:00
2012-12-18 15:02:15 -08:00
2013-02-23 17:50:17 -08:00
2013-01-29 19:32:59 -08:00
2013-02-26 20:16:07 -08:00
2013-02-23 17:50:08 -08:00
2013-03-02 09:34:39 -08:00
2012-12-12 17:38:32 -08:00
2012-07-31 18:42:47 -07:00
2013-01-04 16:11:46 -08:00
2013-02-28 13:21:44 -08:00
2012-12-12 17:38:31 -08:00
2012-06-20 14:39:36 -07:00
2012-12-02 06:23:04 -08:00
2012-12-11 14:28:34 +00:00
2012-05-31 17:49:32 -07:00
2011-10-31 09:20:11 -04:00
2012-09-26 22:20:08 -04:00
2013-02-23 17:50:17 -08:00
2013-03-01 23:50:45 -05:00
2012-12-18 15:02:14 -08:00
2013-01-21 17:17:57 +10:30
2012-12-18 15:02:14 -08:00
2013-02-23 17:50:18 -08:00
2013-02-25 15:41:43 -08:00
2011-10-31 09:20:11 -04:00
2013-02-23 17:50:15 -08:00
2013-02-23 17:50:17 -08:00
2013-02-23 17:50:17 -08:00
2013-02-26 20:16:07 -08:00
2012-12-20 18:46:29 -05:00
2013-02-23 17:50:17 -08:00
2013-02-23 17:50:21 -08:00
2013-02-23 17:50:22 -08:00
2013-02-23 17:50:20 -08:00