Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | block/blk-rq-qos.c |
bool rq_wait_inc_below(struct rq_wait *rq_wait, unsigned int limit) {
return atomic_inc_below(&rq_wait->inflight, limit);
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.c |
void __rq_qos_issue(struct rq_qos *rqos, struct request *rq) {
do {
if (rqos->ops->issue)
rqos->ops->issue(rqos, rq);
rqos = rqos->next;
} while (rqos);
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.c | bool rq_depth_calc_max_depth(struct rq_depth *rqd) {
unsigned int depth;
bool ret = false;
if (rqd->queue_depth == 1) {
if (rqd->scale_step > 0)
rqd->max_depth = 1;
else {
rqd->max_depth = 2;
ret = true;
}
} else {
/*
* scale_step == 0 is our default state. If we have suf... | [
1,
0
] |
Linux Kernel | block/blk-rq-qos.c | bool rq_depth_scale_down(struct rq_depth *rqd, bool hard_throttle) {
if (rqd->max_depth == 1)
return false;
if (rqd->scale_step < 0 && hard_throttle)
rqd->scale_step = 0;
else
rqd->scale_step++;
rqd->scaled_max = false;
rq_depth_calc_max_depth(rqd);
return true;
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.c | void rq_qos_wait(struct rq_wait *rqw, void *private_data,
acquire_inflight_cb_t *acquire_inflight_cb,
cleanup_cb_t *cleanup_cb) {
struct rq_qos_wait_data data = {
.wq =
{
.func = rq_qos_wake_function,
.entry = LIST_HEAD_INIT(data.wq.entry),... | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.h |
static inline struct rq_qos *wbt_rq_qos(struct request_queue *q) {
return rq_qos_id(q, RQ_QOS_WBT);
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.h |
static inline struct rq_qos *blkcg_rq_qos(struct request_queue *q) {
return rq_qos_id(q, RQ_QOS_LATENCY);
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.h |
static inline void rq_qos_done(struct request_queue *q, struct request *rq) {
if (q->rq_qos)
__rq_qos_done(q->rq_qos, rq);
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.h |
static inline void rq_qos_done_bio(struct bio *bio) {
if (bio->bi_bdev && (bio_flagged(bio, BIO_QOS_THROTTLED) ||
bio_flagged(bio, BIO_QOS_MERGED))) {
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
if (q->rq_qos)
__rq_qos_done_bio(q->rq_qos, bio);
}
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.h |
static inline void rq_qos_track(struct request_queue *q, struct request *rq,
struct bio *bio) {
if (q->rq_qos)
__rq_qos_track(q->rq_qos, rq, bio);
} | [
0,
0
] |
Linux Kernel | block/blk-rq-qos.h |
static inline void rq_qos_queue_depth_changed(struct request_queue *q) {
if (q->rq_qos)
__rq_qos_queue_depth_changed(q->rq_qos);
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_queue_bounce_limit(struct request_queue *q, enum blk_bounce bounce) {
q->limits.bounce = bounce;
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_queue_max_discard_sectors(struct request_queue *q,
unsigned int max_discard_sectors) {
q->limits.max_hw_discard_sectors = max_discard_sectors;
q->limits.max_discard_sectors = max_discard_sectors;
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_queue_max_write_zeroes_sectors(struct request_queue *q,
unsigned int max_write_zeroes_sectors) {
q->limits.max_write_zeroes_sectors = max_write_zeroes_sectors;
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_queue_logical_block_size(struct request_queue *q, unsigned int size) {
struct queue_limits *limits = &q->limits;
limits->logical_block_size = size;
if (limits->physical_block_size < size)
limits->physical_block_size = size;
if (limits->io_min < limits->physical_block_size)
limits->io_min = l... | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void disk_update_readahead(struct gendisk *disk) {
struct request_queue *q = disk->queue;
disk->bdi->ra_pages =
max(queue_io_opt(q) * 2 / PAGE_SIZE, VM_READAHEAD_PAGES);
disk->bdi->io_pages = queue_max_sectors(q) >> (PAGE_SHIFT - 9);
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt) {
limits->io_opt = opt;
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_queue_io_opt(struct request_queue *q, unsigned int opt) {
blk_limits_io_opt(&q->limits, opt);
if (!q->disk)
return;
q->disk->bdi->ra_pages =
max(queue_io_opt(q) * 2 / PAGE_SIZE, VM_READAHEAD_PAGES);
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c |
static unsigned int blk_round_down_sectors(unsigned int sectors,
unsigned int lbs) {
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
if (sectors < PAGE_SIZE >> SECTOR_SHIFT)
sectors = PAGE_SIZE >> SECTOR_SHIFT;
return sectors;
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
sector_t offset) {
struct request_queue *t = disk->queue;
if (blk_stack_limits(&t->limits, &bdev_get_queue(bdev)->limits,
get_start_sect(bdev) + (offset >> 9)) < 0)
pr_notice("%s: Warning: Devi... | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_queue_virt_boundary(struct request_queue *q, unsigned long mask) {
q->limits.virt_boundary_mask = mask;
if (mask)
q->limits.max_segment_size = UINT_MAX;
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_set_queue_depth(struct request_queue *q, unsigned int depth) {
q->queue_depth = depth;
rq_qos_queue_depth_changed(q);
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c | void blk_queue_required_elevator_features(struct request_queue *q,
unsigned int features) {
q->required_elevator_features = features;
} | [
0,
0
] |
Linux Kernel | block/blk-settings.c |
int bdev_alignment_offset(struct block_device *bdev) {
struct request_queue *q = bdev_get_queue(bdev);
if (q->limits.misaligned)
return -1;
if (bdev_is_partition(bdev))
return queue_limit_alignment_offset(&q->limits, bdev->bd_start_sect);
return q->limits.alignment_offset;
} | [
0,
0
] |
Linux Kernel | block/blk-stat.c | void blk_rq_stat_sum(struct blk_rq_stat *dst, struct blk_rq_stat *src) {
if (!src->nr_samples)
return;
dst->min = min(dst->min, src->min);
dst->max = max(dst->max, src->max);
dst->mean = div_u64(src->batch + dst->mean * dst->nr_samples,
dst->nr_samples + src->nr_samples);
dst->nr_... | [
1,
0
] |
Linux Kernel | block/blk-stat.c |
struct blk_stat_callback *
blk_stat_alloc_callback(void (*timer_fn)(struct blk_stat_callback *),
int (*bucket_fn)(const struct request *),
unsigned int buckets, void *data) {
struct blk_stat_callback *cb;
cb = kmalloc(sizeof(*cb), GFP_KERNEL);
if (!cb)
return ... | [
1,
0
] |
Linux Kernel | block/blk-stat.c |
void blk_stat_free_callback(struct blk_stat_callback *cb) {
if (cb)
call_rcu(&cb->rcu, blk_stat_free_callback_rcu);
} | [
0,
0
] |
Linux Kernel | block/blk-stat.c |
void blk_stat_enable_accounting(struct request_queue *q) {
unsigned long flags;
spin_lock_irqsave(&q->stats->lock, flags);
if (!q->stats->accounting++)
blk_queue_flag_set(QUEUE_FLAG_STATS, q);
spin_unlock_irqrestore(&q->stats->lock, flags);
} | [
1,
0
] |
Linux Kernel | block/blk-stat.c |
void blk_free_queue_stats(struct blk_queue_stats *stats) {
if (!stats)
return;
WARN_ON(!list_empty(&stats->callbacks));
kfree(stats);
} | [
0,
0
] |
Linux Kernel | block/blk-stat.h | static inline void blk_stat_activate_msecs(struct blk_stat_callback *cb,
unsigned int msecs) {
mod_timer(&cb->timer, jiffies + msecs_to_jiffies(msecs));
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_var_show(unsigned long var, char *page) {
return sprintf(page, "%lu\n", var);
} | [
1,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_var_store(unsigned long *var, const char *page,
size_t count) {
int err;
unsigned long v;
err = kstrtoul(page, 10, &v);
if (err || v > UINT_MAX)
return -EINVAL;
*var = v;
return count;
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_requests_store(struct request_queue *q, const char *page,
size_t count) {
unsigned long nr;
int ret, err;
if (!queue_is_mq(q))
return -EINVAL;
ret = queue_var_store(&nr, page, count);
if (ret < 0)
return ret;
if (nr < BLKDEV_MIN_RQ)
nr... | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_ra_store(struct request_queue *q, const char *page,
size_t count) {
unsigned long ra_kb;
ssize_t ret;
if (!q->disk)
return -EINVAL;
ret = queue_var_store(&ra_kb, page, count);
if (ret < 0)
return ret;
q->disk->bdi->ra_pages = ra_kb >> (PAGE_SHIFT ... | [
1,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_max_segments_show(struct request_queue *q, char *page) {
return queue_var_show(queue_max_segments(q), page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_io_min_show(struct request_queue *q, char *page) {
return queue_var_show(queue_io_min(q), page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_io_opt_show(struct request_queue *q, char *page) {
return queue_var_show(queue_io_opt(q), page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_discard_max_show(struct request_queue *q, char *page) {
return sprintf(page, "%llu\n",
(unsigned long long)q->limits.max_discard_sectors << 9);
} | [
1,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_discard_max_store(struct request_queue *q,
const char *page, size_t count) {
unsigned long max_discard;
ssize_t ret = queue_var_store(&max_discard, page, count);
if (ret < 0)
return ret;
if (max_discard & (q->limits.discard_granularity - 1))
... | [
1,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_discard_zeroes_data_show(struct request_queue *q,
char *page) {
return queue_var_show(0, page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_max_sectors_store(struct request_queue *q,
const char *page, size_t count) {
unsigned long max_sectors_kb,
max_hw_sectors_kb = queue_max_hw_sectors(q) >> 1,
page_kb = 1 << (PAGE_SHIFT - 10);
ssize_t ret = queue_var_store(&max_sectors_kb, page,... | [
1,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page) {
int max_hw_sectors_kb = queue_max_hw_sectors(q) >> 1;
return queue_var_show(max_hw_sectors_kb, page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_nr_zones_show(struct request_queue *q, char *page) {
return queue_var_show(disk_nr_zones(q->disk), page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_max_open_zones_show(struct request_queue *q, char *page) {
return queue_var_show(bdev_max_open_zones(q->disk->part0), page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
size_t count) {
unsigned long nm;
ssize_t ret = queue_var_store(&nm, page, count);
if (ret < 0)
return ret;
blk_queue_flag_clear(QUEUE_FLAG_NOMERGES, q);
blk_queue_flag_clear(QUEUE_FLAG_NO... | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page) {
bool set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);
bool force = test_bit(QUEUE_FLAG_SAME_FORCE, &q->queue_flags);
return queue_var_show(set << force, page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_rq_affinity_store(struct request_queue *q,
const char *page, size_t count) {
ssize_t ret = -EINVAL;
#ifdef CONFIG_SMP
unsigned long val;
ret = queue_var_store(&val, page, count);
if (ret < 0)
return ret;
if (val == 2) {
blk_queue_flag_set(... | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_poll_show(struct request_queue *q, char *page) {
return queue_var_show(test_bit(QUEUE_FLAG_POLL, &q->queue_flags), page);
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_io_timeout_store(struct request_queue *q, const char *page,
size_t count) {
unsigned int val;
int err;
err = kstrtou32(page, 10, &val);
if (err || val == 0)
return -EINVAL;
blk_queue_rq_timeout(q, msecs_to_jiffies(val));
return count;
} | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_wb_lat_show(struct request_queue *q, char *page) {
if (!wbt_rq_qos(q))
return -EINVAL;
if (wbt_disabled(q))
return sprintf(page, "0\n");
return sprintf(page, "%llu\n", div_u64(wbt_get_min_lat(q), 1000));
} | [
1,
0
] |
Linux Kernel | block/blk-sysfs.c | static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page,
size_t count) {
struct rq_qos *rqos;
ssize_t ret;
s64 val;
ret = queue_var_store64(&val, page);
if (ret < 0)
return ret;
if (val < -1)
return -EINVAL;
rqos = wbt_rq_qos(q);
if (!rqos)... | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_dax_show(struct request_queue *q, char *page) {
return queue_var_show(blk_queue_dax(q), page);
}
#define QUEUE_RO_ENTRY(_prefix, _name) \
static struct queue_sysfs_entry _prefix##_entry = { \
.attr = {.name = _name, .mode ... | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static ssize_t queue_attr_store(struct kobject *kobj, struct attribute *attr,
const char *page, size_t length) {
struct queue_sysfs_entry *entry = to_queue(attr);
struct gendisk *disk = container_of(kobj, struct gendisk, queue_kobj);
struct request_queue *q = disk->queue;
ssize_... | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c |
static void blk_debugfs_remove(struct gendisk *disk) {
struct request_queue *q = disk->queue;
mutex_lock(&q->debugfs_mutex);
blk_trace_shutdown(q);
debugfs_remove_recursive(q->debugfs_dir);
q->debugfs_dir = NULL;
q->sched_debugfs_dir = NULL;
q->rqos_debugfs_dir = NULL;
mutex_unlock(&q->debugfs_mutex);... | [
0,
0
] |
Linux Kernel | block/blk-sysfs.c | void blk_unregister_queue(struct gendisk *disk) {
struct request_queue *q = disk->queue;
if (WARN_ON(!q))
return;
if (!blk_queue_registered(q))
return;
/*
* Since sysfs_remove_dir() prevents adding new directory entries
* before removal of existing entries starts, protect against
* concurren... | [
0,
0
] |
Linux Kernel | block/blk-throttle.c | static uint64_t throtl_adjusted_limit(uint64_t low, struct throtl_data *td) {
if (td->scale < 4096 &&
time_after_eq(jiffies,
td->low_upgrade_time + td->scale * td->throtl_slice))
td->scale = (jiffies - td->low_upgrade_time) / td->throtl_slice;
return low + (low >> 1) * td->scale;
} | [
0,
0
] |
Linux Kernel | block/blk-throttle.c | static struct bio *throtl_peek_queued(struct list_head *queued) {
struct throtl_qnode *qn;
struct bio *bio;
if (list_empty(queued))
return NULL;
qn = list_first_entry(queued, struct throtl_qnode, node);
bio = bio_list_peek(&qn->bios);
WARN_ON_ONCE(!bio);
return bio;
} | [
0,
0
] |
Linux Kernel | block/blk-throttle.c | static void throtl_pd_init(struct blkg_policy_data *pd) {
struct throtl_grp *tg = pd_to_tg(pd);
struct blkcg_gq *blkg = tg_to_blkg(tg);
struct throtl_data *td = blkg->q->td;
struct throtl_service_queue *sq = &tg->service_queue;
sq->parent_sq = &td->service_queue;
if (cgroup_subsys_on_dfl(io_cgrp_subsys) &&... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c | static void tg_update_has_rules(struct throtl_grp *tg) {
struct throtl_grp *parent_tg = sq_to_tg(tg->service_queue.parent_sq);
struct throtl_data *td = tg->td;
int rw;
for (rw = READ; rw <= WRITE; rw++) {
tg->has_rules_iops[rw] =
(parent_tg && parent_tg->has_rules_iops[rw]) ||
(td->limit_va... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c | static void blk_throtl_update_limit_valid(struct throtl_data *td) {
struct cgroup_subsys_state *pos_css;
struct blkcg_gq *blkg;
bool low_valid = false;
rcu_read_lock();
blkg_for_each_descendant_post(blkg, pos_css, td->queue->root_blkg) {
struct throtl_grp *tg = blkg_to_tg(blkg);
if (tg->bps[READ][LI... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c |
static void update_min_dispatch_time(struct throtl_service_queue *parent_sq) {
struct throtl_grp *tg;
tg = throtl_rb_first(parent_sq);
if (!tg)
return;
parent_sq->first_pending_disptime = tg->disptime;
} | [
0,
0
] |
Linux Kernel | block/blk-throttle.c |
static void throtl_enqueue_tg(struct throtl_grp *tg) {
if (!(tg->flags & THROTL_TG_PENDING)) {
tg_service_queue_add(tg);
tg->flags |= THROTL_TG_PENDING;
tg->service_queue.parent_sq->nr_pending++;
}
} | [
1,
0
] |
Linux Kernel | block/blk-throttle.c | static void throtl_schedule_pending_timer(struct throtl_service_queue *sq,
unsigned long expires) {
unsigned long max_expire = jiffies + 8 * sq_to_td(sq)->throtl_slice;
if (time_after(expires, max_expire))
expires = max_expire;
mod_timer(&sq->pending_timer, expires);... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c | static inline void throtl_start_new_slice_with_credit(struct throtl_grp *tg,
bool rw,
unsigned long start) {
tg->bytes_disp[rw] = 0;
tg->io_disp[rw] = 0;
tg->carryover_bytes[rw] = 0;
tg->carryover_ios[rw]... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c | static unsigned int calculate_io_allowed(u32 iops_limit,
unsigned long jiffy_elapsed) {
unsigned int io_allowed;
u64 tmp;
tmp = (u64)iops_limit * jiffy_elapsed;
do_div(tmp, HZ);
if (tmp > UINT_MAX)
io_allowed = UINT_MAX;
else
io_allowed = tmp;
return io_... | [
0,
0
] |
Linux Kernel | block/blk-throttle.c | static void tg_update_carryover(struct throtl_grp *tg) {
if (tg->service_queue.nr_queued[READ])
__tg_update_carryover(tg, READ);
if (tg->service_queue.nr_queued[WRITE])
__tg_update_carryover(tg, WRITE);
throtl_log(&tg->service_queue, "%s: %llu %llu %u %u\n", __func__,
tg->carryover_bytes[REA... | [
0,
0
] |
Linux Kernel | block/blk-throttle.c |
static int throtl_select_dispatch(struct throtl_service_queue *parent_sq) {
unsigned int nr_disp = 0;
while (1) {
struct throtl_grp *tg;
struct throtl_service_queue *sq;
if (!parent_sq->nr_pending)
break;
tg = throtl_rb_first(parent_sq);
if (!tg)
break;
if (time_before(jiffi... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c | static void throtl_pending_timer_fn(struct timer_list *t) {
struct throtl_service_queue *sq = from_timer(sq, t, pending_timer);
struct throtl_grp *tg = sq_to_tg(sq);
struct throtl_data *td = sq_to_td(sq);
struct throtl_service_queue *parent_sq;
struct request_queue *q;
bool dispatched;
int ret;
if (tg)... | [
0,
0
] |
Linux Kernel | block/blk-throttle.c | static void tg_conf_updated(struct throtl_grp *tg, bool global) {
struct throtl_service_queue *sq = &tg->service_queue;
struct cgroup_subsys_state *pos_css;
struct blkcg_gq *blkg;
throtl_log(&tg->service_queue,
"limit change rbps=%llu wbps=%llu riops=%u wiops=%u",
tg_bps_limit(tg, REA... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c |
static ssize_t tg_set_conf_u64(struct kernfs_open_file *of, char *buf,
size_t nbytes, loff_t off) {
return tg_set_conf(of, buf, nbytes, off, true);
} | [
0,
0
] |
Linux Kernel | block/blk-throttle.c |
static int tg_print_limit(struct seq_file *sf, void *v) {
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_limit,
&blkcg_policy_throtl, seq_cft(sf)->private, false);
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-throttle.c |
static void throtl_upgrade_check(struct throtl_grp *tg) {
unsigned long now = jiffies;
if (tg->td->limit_index != LIMIT_LOW)
return;
if (time_after(tg->last_check_time + tg->td->throtl_slice, now))
return;
tg->last_check_time = now;
if (!time_after_eq(now,
__tg_last_low_overf... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c |
static void throtl_upgrade_check(struct throtl_grp *tg) {} | [
0,
0
] |
Linux Kernel | block/blk-throttle.c |
void blk_throtl_stat_add(struct request *rq, u64 time_ns) {
struct request_queue *q = rq->q;
struct throtl_data *td = q->td;
throtl_track_latency(td, blk_rq_stats_sectors(rq), req_op(rq), time_ns >> 10);
} | [
0,
0
] |
Linux Kernel | block/blk-throttle.c | void blk_throtl_bio_endio(struct bio *bio) {
struct blkcg_gq *blkg;
struct throtl_grp *tg;
u64 finish_time_ns;
unsigned long finish_time;
unsigned long start_time;
unsigned long lat;
int rw = bio_data_dir(bio);
blkg = bio->bi_blkg;
if (!blkg)
return;
tg = blkg_to_tg(blkg);
if (!tg->td->limit_... | [
1,
0
] |
Linux Kernel | block/blk-throttle.c |
static int __init throtl_init(void) {
kthrotld_workqueue = alloc_workqueue("kthrotld", WQ_MEM_RECLAIM, 0);
if (!kthrotld_workqueue)
panic("Failed to create kthrotld\n");
return blkcg_policy_register(&blkcg_policy_throtl);
} | [
0,
0
] |
Linux Kernel | block/blk-timeout.c | static inline unsigned long blk_round_jiffies(unsigned long j) {
return (j + blk_timeout_mask) + 1;
} | [
0,
0
] |
Linux Kernel | block/blk-timeout.c |
unsigned long blk_rq_timeout(unsigned long timeout) {
unsigned long maxt;
maxt = blk_round_jiffies(jiffies + BLK_MAX_TIMEOUT);
if (time_after(timeout, maxt))
timeout = maxt;
return timeout;
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static inline void wbt_clear_state(struct request *rq) { rq->wbt_flags = 0; } | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static inline bool rwb_enabled(struct rq_wb *rwb) {
return rwb && rwb->enable_state != WBT_STATE_OFF_DEFAULT &&
rwb->wb_normal != 0;
} | [
1,
0
] |
Linux Kernel | block/blk-wbt.c |
static void wb_timestamp(struct rq_wb *rwb, unsigned long *var) {
if (rwb_enabled(rwb)) {
const unsigned long cur = jiffies;
if (cur != *var)
*var = cur;
}
} | [
1,
0
] |
Linux Kernel | block/blk-wbt.c | static bool wb_recent_wait(struct rq_wb *rwb) {
struct bdi_writeback *wb = &rwb->rqos.q->disk->bdi->wb;
return time_before(jiffies, wb->dirty_sleep + HZ);
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c | static inline bool stat_sample_valid(struct blk_rq_stat *stat) {
return (stat[READ].nr_samples >= 1 &&
stat[WRITE].nr_samples >= RWB_MIN_WRITE_SAMPLES);
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static u64 rwb_sync_issue_lat(struct rq_wb *rwb) {
u64 now, issue = READ_ONCE(rwb->sync_issue);
if (!issue || !rwb->sync_cookie)
return 0;
now = ktime_to_ns(ktime_get());
return now - issue;
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c | static void wb_timer_fn(struct blk_stat_callback *cb) {
struct rq_wb *rwb = cb->data;
struct rq_depth *rqd = &rwb->rq_depth;
unsigned int inflight = wbt_inflight(rwb);
int status;
if (!rwb->rqos.q->disk)
return;
status = latency_exceeded(rwb, cb->stat);
trace_wbt_timer(rwb->rqos.q->disk->bdi, statu... | [
1,
0
] |
Linux Kernel | block/blk-wbt.c |
bool wbt_disabled(struct request_queue *q) {
struct rq_qos *rqos = wbt_rq_qos(q);
return !rqos || RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT ||
RQWB(rqos)->enable_state == WBT_STATE_OFF_MANUAL;
} | [
1,
0
] |
Linux Kernel | block/blk-wbt.c | static inline unsigned int get_limit(struct rq_wb *rwb, blk_opf_t opf) {
unsigned int limit;
if (!rwb_enabled(rwb))
return UINT_MAX;
if ((opf & REQ_OP_MASK) == REQ_OP_DISCARD)
return rwb->wb_background;
/*
* At this point we know it's a buffered write. If this is
* kswapd trying to free memory,... | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static void wbt_cleanup_cb(struct rq_wait *rqw, void *private_data) {
struct wbt_wait_data *data = private_data;
wbt_rqw_done(data->rwb, rqw, data->wb_acct);
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static void wbt_cleanup(struct rq_qos *rqos, struct bio *bio) {
struct rq_wb *rwb = RQWB(rqos);
enum wbt_flags flags = bio_to_wbt_flags(rwb, bio);
__wbt_done(rqos, flags);
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static void wbt_queue_depth_changed(struct rq_qos *rqos) {
RQWB(rqos)->rq_depth.queue_depth = blk_queue_depth(rqos->q);
wbt_update_limits(RQWB(rqos));
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static int wbt_enabled_show(void *data, struct seq_file *m) {
struct rq_qos *rqos = data;
struct rq_wb *rwb = RQWB(rqos);
seq_printf(m, "%d\n", rwb->enable_state);
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.c |
static int wbt_background_show(void *data, struct seq_file *m) {
struct rq_qos *rqos = data;
struct rq_wb *rwb = RQWB(rqos);
seq_printf(m, "%u\n", rwb->wb_background);
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-wbt.h | static inline void wbt_disable_default(struct request_queue *q) {} | [
0,
0
] |
Linux Kernel | block/blk-wbt.h | static inline void wbt_set_min_lat(struct request_queue *q, u64 val) {} | [
0,
0
] |
Linux Kernel | block/blk-wbt.h | static inline u64 wbt_default_latency_nsec(struct request_queue *q) {
return 0;
} | [
0,
0
] |
Linux Kernel | block/blk-zoned.c | const char *blk_zone_cond_str(enum blk_zone_cond zone_cond) {
static const char *zone_cond_str = "UNKNOWN";
if (zone_cond < ARRAY_SIZE(zone_cond_name) && zone_cond_name[zone_cond])
zone_cond_str = zone_cond_name[zone_cond];
return zone_cond_str;
} | [
0,
1
] |
Linux Kernel | block/blk-zoned.c | bool blk_req_needs_zone_write_lock(struct request *rq) {
if (blk_rq_is_passthrough(rq))
return false;
if (!rq->q->disk->seq_zones_wlock)
return false;
if (bdev_op_is_zoned_write(rq->q->disk->part0, req_op(rq)))
return blk_rq_zone_is_seq(rq);
return false;
} | [
1,
0
] |
Linux Kernel | block/blk-zoned.c | unsigned int bdev_nr_zones(struct block_device *bdev) {
sector_t zone_sectors = bdev_zone_sectors(bdev);
if (!bdev_is_zoned(bdev))
return 0;
return (bdev_nr_sectors(bdev) + zone_sectors - 1) >> ilog2(zone_sectors);
} | [
1,
0
] |
Linux Kernel | block/blk-zoned.c | int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op, sector_t sector,
sector_t nr_sectors, gfp_t gfp_mask) {
struct request_queue *q = bdev_get_queue(bdev);
sector_t zone_sectors = bdev_zone_sectors(bdev);
sector_t capacity = bdev_nr_sectors(bdev);
sector_t end_sector = sector + ... | [
1,
0
] |
Linux Kernel | block/blk-zoned.c | static int blkdev_truncate_zone_range(struct block_device *bdev, fmode_t mode,
const struct blk_zone_range *zrange) {
loff_t start, end;
if (zrange->sector + zrange->nr_sectors <= zrange->sector ||
zrange->sector + zrange->nr_sectors > get_capacity(bdev->bd_disk))
r... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.