Release 4.7 block/blk-mq-cpu.c
/*
* CPU notifier helper code for blk-mq
*
* Copyright (C) 2013-2014 Jens Axboe
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/list.h>
#include <linux/llist.h>
#include <linux/smp.h>
#include <linux/cpu.h>
#include <linux/blk-mq.h>
#include "blk-mq.h"
static LIST_HEAD(blk_mq_cpu_notify_list);
static DEFINE_RAW_SPINLOCK(blk_mq_cpu_notify_lock);
static int blk_mq_main_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long) hcpu;
struct blk_mq_cpu_notifier *notify;
int ret = NOTIFY_OK;
raw_spin_lock(&blk_mq_cpu_notify_lock);
list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) {
ret = notify->notify(notify->data, action, cpu);
if (ret != NOTIFY_OK)
break;
}
raw_spin_unlock(&blk_mq_cpu_notify_lock);
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jens axboe | jens axboe | 84 | 97.67% | 2 | 66.67% |
mike galbraith | mike galbraith | 2 | 2.33% | 1 | 33.33% |
| Total | 86 | 100.00% | 3 | 100.00% |
void blk_mq_register_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
{
BUG_ON(!notifier->notify);
raw_spin_lock(&blk_mq_cpu_notify_lock);
list_add_tail(¬ifier->list, &blk_mq_cpu_notify_list);
raw_spin_unlock(&blk_mq_cpu_notify_lock);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jens axboe | jens axboe | 39 | 95.12% | 1 | 50.00% |
mike galbraith | mike galbraith | 2 | 4.88% | 1 | 50.00% |
| Total | 41 | 100.00% | 2 | 100.00% |
void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
{
raw_spin_lock(&blk_mq_cpu_notify_lock);
list_del(¬ifier->list);
raw_spin_unlock(&blk_mq_cpu_notify_lock);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jens axboe | jens axboe | 28 | 93.33% | 1 | 50.00% |
mike galbraith | mike galbraith | 2 | 6.67% | 1 | 50.00% |
| Total | 30 | 100.00% | 2 | 100.00% |
void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,
int (*fn)(void *, unsigned long, unsigned int),
void *data)
{
notifier->notify = fn;
notifier->data = data;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jens axboe | jens axboe | 42 | 100.00% | 2 | 100.00% |
| Total | 42 | 100.00% | 2 | 100.00% |
void __init blk_mq_cpu_init(void)
{
hotcpu_notifier(blk_mq_main_cpu_notify, 0);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jens axboe | jens axboe | 11 | 73.33% | 1 | 50.00% |
andrew morton | andrew morton | 4 | 26.67% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jens axboe | jens axboe | 246 | 95.72% | 3 | 60.00% |
mike galbraith | mike galbraith | 7 | 2.72% | 1 | 20.00% |
andrew morton | andrew morton | 4 | 1.56% | 1 | 20.00% |
| Total | 257 | 100.00% | 5 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.