mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Paolo Valente <paolo.valente@unimore.it>
Cc: Jens Axboe <axboe@kernel.dk>, Li Zefan <lizefan@huawei.com>,
	Fabio Checconi <fchecconi@gmail.com>,
	Arianna Avanzini <avanzini.arianna@gmail.com>,
	Paolo Valente <posta_paolo@yahoo.it>,
	linux-kernel@vger.kernel.org,
	containers@lists.linux-foundation.org, cgroups@vger.kernel.org
Subject: Re: [PATCH RFC - TAKE TWO - 11/12] block, bfq: boost the throughput on NCQ-capable flash-based devices
Date: Sat, 31 May 2014 07:52:16 -0400	[thread overview]
Message-ID: <20140531115216.GB5057@htj.dyndns.org> (raw)
In-Reply-To: <1401354343-5527-12-git-send-email-paolo.valente@unimore.it>

Hello, Paolo.

So, I've actually looked at the code.  Here are some questions.

On Thu, May 29, 2014 at 11:05:42AM +0200, Paolo Valente wrote:
> + * 1) all active queues have the same weight,
> + * 2) all active groups at the same level in the groups tree have the same
> + *    weight,
> + * 3) all active groups at the same level in the groups tree have the same
> + *    number of children.

3) basically disables it whenever blkcg is used.  Might as well just
skip the whole thing if there are any !root cgroups.  It's only
theoretically interesting.

>  static inline bool bfq_bfqq_must_not_expire(struct bfq_queue *bfqq)
>  {
>  	struct bfq_data *bfqd = bfqq->bfqd;

	bool symmetric_scenario, expire_non_wr;

> +#ifdef CONFIG_CGROUP_BFQIO
> +#define symmetric_scenario	  (!bfqd->active_numerous_groups && \
> +				   !bfq_differentiated_weights(bfqd))

	symmetric_scenario = xxx;

> +#else
> +#define symmetric_scenario	  (!bfq_differentiated_weights(bfqd))

	symmetric_scenario = yyy;

> +#endif
>  /*
>   * Condition for expiring a non-weight-raised queue (and hence not idling
>   * the device).
>   */
>  #define cond_for_expiring_non_wr  (bfqd->hw_tag && \
> -				   bfqd->wr_busy_queues > 0)
> +				   (bfqd->wr_busy_queues > 0 || \
> +				    (symmetric_scenario && \
> +				     blk_queue_nonrot(bfqd->queue))))

	expire_non_wr = zzz;

>  
>  	return bfq_bfqq_sync(bfqq) && (
>  		bfqq->wr_coeff > 1 ||
>  /**
> + * struct bfq_weight_counter - counter of the number of all active entities
> + *                             with a given weight.
> + * @weight: weight of the entities that this counter refers to.
> + * @num_active: number of active entities with this weight.
> + * @weights_node: weights tree member (see bfq_data's @queue_weights_tree
> + *                and @group_weights_tree).
> + */
> +struct bfq_weight_counter {
> +	short int weight;
> +	unsigned int num_active;
> +	struct rb_node weights_node;
> +};

This is way over-engineered.  In most cases, the only time you get the
same weight on all IO issuers would be when everybody is on the
default ioprio so might as well simply count the number of non-default
ioprios.  It'd be one integer instead of a tree of counters.

> @@ -306,6 +322,22 @@ enum bfq_device_speed {
>   * @rq_pos_tree: rbtree sorted by next_request position, used when
>   *               determining if two or more queues have interleaving
>   *               requests (see bfq_close_cooperator()).
> + * @active_numerous_groups: number of bfq_groups containing more than one
> + *                          active @bfq_entity.

You can safely assume that on any system which uses blkcg, the above
counter is >1.

This optimization may be theoretically interesting but doesn't seem
practical at all and would make the sytem behave distinctively
differently depending on something which is extremely subtle and seems
completely unrelated.  Furthermore, on any system which uses blkcg,
ext4, btrfs or has any task which has non-zero nice value, it won't
make any difference.  Its value is only theoretical.

Another thing to consider is that virtually all remotely modern
devices, rotational or not, are queued.  At this point, it's rather
pointless to design one behavior for !queued and another for queued.
Things should just be designed for queued devices.  I don't know what
the solution is but given that the benefits of NCQ for rotational
devices is extremely limited, sticking with single request model in
most cases and maybe allowing queued operation for specific workloads
might be a better approach.  As for ssds, just do something simple.
It's highly likely that most ssds won't travel this code path in the
near future anyway.

Thanks.

-- 
tejun

  parent reply	other threads:[~2014-05-31 11:52 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27 12:42 [PATCH RFC RESEND 00/14] New version of the BFQ I/O Scheduler paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 01/14] block: kconfig update and build bits for BFQ paolo
2014-05-28 22:19   ` Tejun Heo
2014-05-29  9:05     ` [PATCH RFC - TAKE TWO - 00/12] New version of the BFQ I/O Scheduler Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 01/12] block: introduce the BFQ-v0 I/O scheduler Paolo Valente
2014-05-30 15:36         ` Tejun Heo
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 02/12] block, bfq: add full hierarchical scheduling and cgroups support Paolo Valente
2014-05-30 15:37         ` Tejun Heo
2014-05-30 15:39           ` Tejun Heo
2014-05-30 21:49             ` Paolo Valente
2014-05-30 21:49           ` Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 03/12] block, bfq: improve throughput boosting Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 04/12] block, bfq: modify the peak-rate estimator Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 05/12] block, bfq: add more fairness to boost throughput and reduce latency Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 06/12] block, bfq: improve responsiveness Paolo Valente
2014-05-30 15:41         ` Tejun Heo
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 07/12] block, bfq: reduce I/O latency for soft real-time applications Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 08/12] block, bfq: preserve a low latency also with NCQ-capable drives Paolo Valente
2014-05-31 13:48         ` Tejun Heo
2014-06-02  9:58           ` Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 09/12] block, bfq: reduce latency during request-pool saturation Paolo Valente
2014-05-31 13:54         ` Tejun Heo
2014-06-02  9:54           ` Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 10/12] block, bfq: add Early Queue Merge (EQM) Paolo Valente
2014-06-01  0:03         ` Tejun Heo
2014-06-02  9:46           ` Paolo Valente
2014-06-03 16:28             ` Tejun Heo
2014-06-04 11:47               ` Paolo Valente
2014-06-04 13:04                 ` Tejun Heo
2014-06-16 11:23                   ` Paolo Valente
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 11/12] block, bfq: boost the throughput on NCQ-capable flash-based devices Paolo Valente
2014-05-30 15:46         ` Tejun Heo
2014-05-30 22:01           ` Paolo Valente
2014-05-31 11:52         ` Tejun Heo [this message]
2014-06-02  9:26           ` Paolo Valente
2014-06-03 17:11             ` Tejun Heo
2014-06-04  7:29               ` Paolo Valente
2014-06-04 13:56                 ` Tejun Heo
2014-06-16 10:46                   ` Paolo Valente
2014-06-19  1:14                     ` Tejun Heo
2014-05-29  9:05       ` [PATCH RFC - TAKE TWO - 12/12] block, bfq: boost the throughput with random I/O on NCQ-capable HDDs Paolo Valente
2014-05-30 15:51         ` Tejun Heo
2014-05-31 13:34         ` Tejun Heo
2014-05-30 16:07       ` [PATCH RFC - TAKE TWO - 00/12] New version of the BFQ I/O Scheduler Tejun Heo
2014-05-30 22:23         ` Paolo Valente
2014-05-30 23:28           ` Tejun Heo
2014-05-30 23:54             ` Paolo Valente
2014-06-02 11:14             ` Pavel Machek
2014-06-02 13:02               ` Pavel Machek
2014-06-03 16:54                 ` Paolo Valente
2014-06-03 20:40                   ` Pavel Machek
2014-06-04  8:39                   ` Pavel Machek
2014-06-04  9:08                   ` Pavel Machek
2014-06-04 10:03                   ` BFQ speed tests [was Re: [PATCH RFC - TAKE TWO - 00/12] New version of the BFQ I/O Scheduler] Pavel Machek
2014-06-04 10:24                     ` Paolo Valente
2014-06-04 11:59                       ` Takashi Iwai
2014-06-04 12:12                         ` Paolo Valente
2014-06-11 20:45                         ` Paolo Valente
2014-06-13 16:21                           ` Takashi Iwai
2014-06-11 20:39                     ` Paolo Valente
2014-06-02 17:33               ` [PATCH RFC - TAKE TWO - 00/12] New version of the BFQ I/O Scheduler Tejun Heo
2014-06-03  4:12                 ` Mike Galbraith
2014-06-04 22:31                 ` Pavel Machek
2014-06-05  2:14                   ` Jens Axboe
2014-05-31  0:48         ` Jens Axboe
2014-05-31  5:16           ` Tejun Heo
2014-06-02 14:29             ` Jens Axboe
2014-06-02 17:24               ` Tejun Heo
2014-06-02 17:32                 ` Jens Axboe
2014-06-02 17:42                   ` Tejun Heo
2014-06-02 17:46                     ` Jens Axboe
2014-06-02 18:51                       ` Tejun Heo
2014-06-02 20:57                         ` Jens Axboe
2014-06-04 14:31                           ` Christoph Hellwig
2014-06-04 14:50                             ` Tejun Heo
2014-06-04 14:53                               ` Christoph Hellwig
2014-06-04 14:58                                 ` Tejun Heo
2014-06-04 17:51                                   ` Christoph Hellwig
2014-06-17 15:55               ` Paolo Valente
2014-06-19  1:46                 ` Tejun Heo
2014-06-19  1:49                   ` Tejun Heo
2014-06-19  2:29                   ` Jens Axboe
2014-06-23 13:53                     ` Paolo Valente
2014-06-23 19:20                       ` Tejun Heo
2014-07-09 20:54                         ` Paolo Valente
2014-05-27 12:42 ` [PATCH RFC RESEND 02/14] block: introduce the BFQ-v0 I/O scheduler paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 03/14] block: add hierarchical-support option to kconfig paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 04/14] block, bfq: add full hierarchical scheduling and cgroups support paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 05/14] block, bfq: improve throughput boosting paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 06/14] block, bfq: modify the peak-rate estimator paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 07/14] block, bfq: add more fairness to boost throughput and reduce latency paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 08/14] block, bfq: improve responsiveness paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 09/14] block, bfq: reduce I/O latency for soft real-time applications paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 10/14] block, bfq: preserve a low latency also with NCQ-capable drives paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 11/14] block, bfq: reduce latency during request-pool saturation paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 12/14] block, bfq: add Early Queue Merge (EQM) paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 13/14] block, bfq: boost the throughput on NCQ-capable flash-based devices paolo
2014-05-27 12:42 ` [PATCH RFC RESEND 14/14] block, bfq: boost the throughput with random I/O on NCQ-capable HDDs paolo
2014-05-30 15:32 ` [PATCH RFC RESEND 00/14] New version of the BFQ I/O Scheduler Vivek Goyal
2014-05-30 16:16   ` Tejun Heo
2014-05-30 17:09     ` Vivek Goyal
2014-05-30 17:26       ` Tejun Heo
2014-05-30 17:55         ` Vivek Goyal
2014-05-30 17:59           ` Tejun Heo
2014-05-30 23:33       ` Paolo Valente
2014-05-30 17:31 ` Vivek Goyal
2014-05-30 17:39   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140531115216.GB5057@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=avanzini.arianna@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=fchecconi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=paolo.valente@unimore.it \
    --cc=posta_paolo@yahoo.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®