Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fed678dc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

* 'for-linus' of git://git.kernel.dk/linux-block:
  floppy: use del_timer_sync() in init cleanup
  blk-cgroup: be able to remove the record of unplugged device
  block: Don't check QUEUE_FLAG_SAME_COMP in __blk_complete_request
  mm: Add comment explaining task state setting in bdi_forker_thread()
  mm: Cleanup clearing of BDI_pending bit in bdi_forker_thread()
  block: simplify force plug flush code a little bit
  block: change force plug flush call order
  block: Fix queue_flag update when rq_affinity goes from 2 to 1
  block: separate priority boosting from REQ_META
  block: remove READ_META and WRITE_META
  xen-blkback: fixed indentation and comments
  xen-blkback: Don't disconnect backend until state switched to XenbusStateClosed.
parents 808bf29b 6c4867f6
Loading
Loading
Loading
Loading
+16 −21
Original line number Diff line number Diff line
@@ -785,10 +785,10 @@ static int blkio_policy_parse_and_set(char *buf,
{
	char *s[4], *p, *major_s = NULL, *minor_s = NULL;
	int ret;
	unsigned long major, minor, temp;
	unsigned long major, minor;
	int i = 0;
	dev_t dev;
	u64 bps, iops;
	u64 temp;

	memset(s, 0, sizeof(s));

@@ -826,19 +826,22 @@ static int blkio_policy_parse_and_set(char *buf,

	dev = MKDEV(major, minor);

	ret = strict_strtoull(s[1], 10, &temp);
	if (ret)
		return -EINVAL;

	/* For rule removal, do not check for device presence. */
	if (temp) {
		ret = blkio_check_dev_num(dev);
		if (ret)
			return ret;
	}

	newpn->dev = dev;

	if (s[1] == NULL)
		return -EINVAL;

	switch (plid) {
	case BLKIO_POLICY_PROP:
		ret = strict_strtoul(s[1], 10, &temp);
		if (ret || (temp < BLKIO_WEIGHT_MIN && temp > 0) ||
		if ((temp < BLKIO_WEIGHT_MIN && temp > 0) ||
		     temp > BLKIO_WEIGHT_MAX)
			return -EINVAL;

@@ -850,26 +853,18 @@ static int blkio_policy_parse_and_set(char *buf,
		switch(fileid) {
		case BLKIO_THROTL_read_bps_device:
		case BLKIO_THROTL_write_bps_device:
			ret = strict_strtoull(s[1], 10, &bps);
			if (ret)
				return -EINVAL;

			newpn->plid = plid;
			newpn->fileid = fileid;
			newpn->val.bps = bps;
			newpn->val.bps = temp;
			break;
		case BLKIO_THROTL_read_iops_device:
		case BLKIO_THROTL_write_iops_device:
			ret = strict_strtoull(s[1], 10, &iops);
			if (ret)
				return -EINVAL;

			if (iops > THROTL_IOPS_MAX)
			if (temp > THROTL_IOPS_MAX)
				return -EINVAL;

			newpn->plid = plid;
			newpn->fileid = fileid;
			newpn->val.iops = (unsigned int)iops;
			newpn->val.iops = (unsigned int)temp;
			break;
		}
		break;
+8 −7
Original line number Diff line number Diff line
@@ -1167,7 +1167,7 @@ static bool bio_attempt_front_merge(struct request_queue *q,
 * true if merge was successful, otherwise false.
 */
static bool attempt_plug_merge(struct task_struct *tsk, struct request_queue *q,
			       struct bio *bio)
			       struct bio *bio, unsigned int *request_count)
{
	struct blk_plug *plug;
	struct request *rq;
@@ -1176,10 +1176,13 @@ static bool attempt_plug_merge(struct task_struct *tsk, struct request_queue *q,
	plug = tsk->plug;
	if (!plug)
		goto out;
	*request_count = 0;

	list_for_each_entry_reverse(rq, &plug->list, queuelist) {
		int el_ret;

		(*request_count)++;

		if (rq->q != q)
			continue;

@@ -1219,6 +1222,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
	struct blk_plug *plug;
	int el_ret, rw_flags, where = ELEVATOR_INSERT_SORT;
	struct request *req;
	unsigned int request_count = 0;

	/*
	 * low level driver can indicate that it wants pages above a
@@ -1237,7 +1241,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
	 * Check if we can merge with the plugged list before grabbing
	 * any locks.
	 */
	if (attempt_plug_merge(current, q, bio))
	if (attempt_plug_merge(current, q, bio, &request_count))
		goto out;

	spin_lock_irq(q->queue_lock);
@@ -1302,11 +1306,10 @@ get_rq:
			if (__rq->q != q)
				plug->should_sort = 1;
		}
		if (request_count >= BLK_MAX_REQUEST_COUNT)
			blk_flush_plug_list(plug, false);
		list_add_tail(&req->queuelist, &plug->list);
		plug->count++;
		drive_stat_acct(req, 1);
		if (plug->count >= BLK_MAX_REQUEST_COUNT)
			blk_flush_plug_list(plug, false);
	} else {
		spin_lock_irq(q->queue_lock);
		add_acct_request(q, req, where);
@@ -2634,7 +2637,6 @@ void blk_start_plug(struct blk_plug *plug)
	INIT_LIST_HEAD(&plug->list);
	INIT_LIST_HEAD(&plug->cb_list);
	plug->should_sort = 0;
	plug->count = 0;

	/*
	 * If this is a nested plug, don't actually assign it. It will be
@@ -2718,7 +2720,6 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule)
		return;

	list_splice_init(&plug->list, &list);
	plug->count = 0;

	if (plug->should_sort) {
		list_sort(NULL, &list, plug_rq_cmp);
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ void __blk_complete_request(struct request *req)
	/*
	 * Select completion CPU
	 */
	if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) && req->cpu != -1) {
	if (req->cpu != -1) {
		ccpu = req->cpu;
		if (!test_bit(QUEUE_FLAG_SAME_FORCE, &q->queue_flags)) {
			ccpu = blk_cpu_to_group(ccpu);
+6 −4
Original line number Diff line number Diff line
@@ -258,11 +258,13 @@ queue_rq_affinity_store(struct request_queue *q, const char *page, size_t count)

	ret = queue_var_store(&val, page, count);
	spin_lock_irq(q->queue_lock);
	if (val) {
	if (val == 2) {
		queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
		if (val == 2)
		queue_flag_set(QUEUE_FLAG_SAME_FORCE, q);
	} else {
	} else if (val == 1) {
		queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
		queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
	} else if (val == 0) {
		queue_flag_clear(QUEUE_FLAG_SAME_COMP, q);
		queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
	}
+10 −10
Original line number Diff line number Diff line
@@ -130,8 +130,8 @@ struct cfq_queue {
	unsigned long slice_end;
	long slice_resid;

	/* pending metadata requests */
	int meta_pending;
	/* pending priority requests */
	int prio_pending;
	/* number of requests that are on the dispatch list or inside driver */
	int dispatched;

@@ -684,8 +684,8 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2,
	if (rq_is_sync(rq1) != rq_is_sync(rq2))
		return rq_is_sync(rq1) ? rq1 : rq2;

	if ((rq1->cmd_flags ^ rq2->cmd_flags) & REQ_META)
		return rq1->cmd_flags & REQ_META ? rq1 : rq2;
	if ((rq1->cmd_flags ^ rq2->cmd_flags) & REQ_PRIO)
		return rq1->cmd_flags & REQ_PRIO ? rq1 : rq2;

	s1 = blk_rq_pos(rq1);
	s2 = blk_rq_pos(rq2);
@@ -1612,9 +1612,9 @@ static void cfq_remove_request(struct request *rq)
	cfqq->cfqd->rq_queued--;
	cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg,
					rq_data_dir(rq), rq_is_sync(rq));
	if (rq->cmd_flags & REQ_META) {
		WARN_ON(!cfqq->meta_pending);
		cfqq->meta_pending--;
	if (rq->cmd_flags & REQ_PRIO) {
		WARN_ON(!cfqq->prio_pending);
		cfqq->prio_pending--;
	}
}

@@ -3372,7 +3372,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
	 * So both queues are sync. Let the new request get disk time if
	 * it's a metadata request and the current queue is doing regular IO.
	 */
	if ((rq->cmd_flags & REQ_META) && !cfqq->meta_pending)
	if ((rq->cmd_flags & REQ_PRIO) && !cfqq->prio_pending)
		return true;

	/*
@@ -3439,8 +3439,8 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
	struct cfq_io_context *cic = RQ_CIC(rq);

	cfqd->rq_queued++;
	if (rq->cmd_flags & REQ_META)
		cfqq->meta_pending++;
	if (rq->cmd_flags & REQ_PRIO)
		cfqq->prio_pending++;

	cfq_update_io_thinktime(cfqd, cfqq, cic);
	cfq_update_io_seektime(cfqd, cfqq, rq);
Loading