Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
percpu: print out alloc information with KERN_DEBUG instead of KERN_INFO
kthread_work: make lockdep happy

+46 -10
+34 -9
include/linux/kthread.h
··· 81 81 #define DEFINE_KTHREAD_WORK(work, fn) \ 82 82 struct kthread_work work = KTHREAD_WORK_INIT(work, fn) 83 83 84 - static inline void init_kthread_worker(struct kthread_worker *worker) 85 - { 86 - *worker = (struct kthread_worker)KTHREAD_WORKER_INIT(*worker); 87 - } 84 + /* 85 + * kthread_worker.lock and kthread_work.done need their own lockdep class 86 + * keys if they are defined on stack with lockdep enabled. Use the 87 + * following macros when defining them on stack. 88 + */ 89 + #ifdef CONFIG_LOCKDEP 90 + # define KTHREAD_WORKER_INIT_ONSTACK(worker) \ 91 + ({ init_kthread_worker(&worker); worker; }) 92 + # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) \ 93 + struct kthread_worker worker = KTHREAD_WORKER_INIT_ONSTACK(worker) 94 + # define KTHREAD_WORK_INIT_ONSTACK(work, fn) \ 95 + ({ init_kthread_work((&work), fn); work; }) 96 + # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) \ 97 + struct kthread_work work = KTHREAD_WORK_INIT_ONSTACK(work, fn) 98 + #else 99 + # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) DEFINE_KTHREAD_WORKER(worker) 100 + # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) DEFINE_KTHREAD_WORK(work, fn) 101 + #endif 88 102 89 - static inline void init_kthread_work(struct kthread_work *work, 90 - kthread_work_func_t fn) 91 - { 92 - *work = (struct kthread_work)KTHREAD_WORK_INIT(*work, fn); 93 - } 103 + extern void __init_kthread_worker(struct kthread_worker *worker, 104 + const char *name, struct lock_class_key *key); 105 + 106 + #define init_kthread_worker(worker) \ 107 + do { \ 108 + static struct lock_class_key __key; \ 109 + __init_kthread_worker((worker), "("#worker")->lock", &__key); \ 110 + } while (0) 111 + 112 + #define init_kthread_work(work, fn) \ 113 + do { \ 114 + memset((work), 0, sizeof(struct kthread_work)); \ 115 + INIT_LIST_HEAD(&(work)->node); \ 116 + (work)->func = (fn); \ 117 + init_waitqueue_head(&(work)->done); \ 118 + } while (0) 94 119 95 120 int kthread_worker_fn(void *worker_ptr); 96 121
+11
kernel/kthread.c
··· 265 265 return 0; 266 266 } 267 267 268 + void __init_kthread_worker(struct kthread_worker *worker, 269 + const char *name, 270 + struct lock_class_key *key) 271 + { 272 + spin_lock_init(&worker->lock); 273 + lockdep_set_class_and_name(&worker->lock, key, name); 274 + INIT_LIST_HEAD(&worker->work_list); 275 + worker->task = NULL; 276 + } 277 + EXPORT_SYMBOL_GPL(__init_kthread_worker); 278 + 268 279 /** 269 280 * kthread_worker_fn - kthread function to process kthread_worker 270 281 * @worker_ptr: pointer to initialized kthread_worker
+1 -1
mm/percpu.c
··· 1268 1268 1269 1269 /* we're done parsing the input, undefine BUG macro and dump config */ 1270 1270 #undef PCPU_SETUP_BUG_ON 1271 - pcpu_dump_alloc_info(KERN_INFO, ai); 1271 + pcpu_dump_alloc_info(KERN_DEBUG, ai); 1272 1272 1273 1273 pcpu_nr_groups = ai->nr_groups; 1274 1274 pcpu_group_offsets = group_offsets;