public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Arianna Avanzini <avanzini.arianna@gmail.com>,
	linux-kernel@vger.kernel.org
Cc: tj@kernel.org, paolo.valente@unimore.it, Jens Axboe <axboe@fb.com>
Subject: Re: [PATCH] block, cgroup: implement policy-specific per-blkcg data
Date: Sun, 07 Jun 2015 08:10:37 -0600	[thread overview]
Message-ID: <557450DD.3080302@kernel.dk> (raw)
In-Reply-To: <1433540322-15152-1-git-send-email-avanzini.arianna@gmail.com>

On 06/05/2015 03:38 PM, Arianna Avanzini wrote:
> The block IO (blkio) controller enables the block layer to provide service
> guarantees in a hierarchical fashion. Specifically, service guarantees
> are provided by registered request-accounting policies. As of now, a
> proportional-share and a throttling policy are available. They are
> implemented, respectively, by the CFQ I/O scheduler and the blk-throttle
> subsystem. Unfortunately, as for adding new policies, the current
> implementation of the block IO controller is only halfway ready to allow
> new policies to be plugged in. This commit provides a solution to make
> the block IO controller fully ready to handle new policies.
> In what follows, we first describe briefly the current state, and then
> list the changes made by this commit.
>
> The throttling policy does not need any per-cgroup information to perform
> its task. In contrast, the proportional share policy uses, for each cgroup,
> both the weight assigned by the user to the cgroup, and a set of dynamically-
> computed weights, one for each device.
>
> The first, user-defined weight is stored in the blkcg data structure: the
> block IO controller allocates a private blkcg data structure for each
> cgroup in the blkio cgroups hierarchy (regardless of which policy is active).
> In other words, the block IO controller internally mirrors the blkio cgroups
> with private blkcg data structures.
>
> On the other hand, for each cgroup and device, the corresponding dynamically-
> computed weight is maintained in the following, different way. For each device,
> the block IO controller keeps a private blkcg_gq structure for each cgroup in
> blkio. In other words, block IO also keeps one private mirror copy of the blkio
> cgroups hierarchy for each device, made of blkcg_gq structures.
> Each blkcg_gq structure keeps per-policy information in a generic array of
> dynamically-allocated 'dedicated' data structures, one for each registered
> policy (so currently the array contains two elements). To be inserted into the
> generic array, each dedicated data structure embeds a generic blkg_policy_data
> structure. Consider now the array contained in the blkcg_gq structure
> corresponding to a given pair of cgroup and device: one of the elements
> of the array contains the dedicated data structure for the proportional-share
> policy, and this dedicated data structure contains the dynamically-computed
> weight for that pair of cgroup and device.
>
> The generic strategy adopted for storing per-policy data in blkcg_gq structures
> is already capable of handling new policies, whereas the one adopted with blkcg
> structures is not, because per-policy data are hard-coded in the blkcg
> structures themselves (currently only data related to the proportional-
> share policy).
>
> This commit addresses the above issues through the following changes:
> . It generalizes blkcg structures so that per-policy data are stored in the same
>    way as in blkcg_gq structures.
>    Specifically, it lets also the blkcg structure store per-policy data in a
>    generic array of dynamically-allocated dedicated data structures. We will
>    refer to these data structures as blkcg dedicated data structures, to
>    distinguish them from the dedicated data structures inserted in the generic
>    arrays kept by blkcg_gq structures.
>    To allow blkcg dedicated data structures to be inserted in the generic array
>    inside a blkcg structure, this commit also introduces a new blkcg_policy_data
>    structure, which is the equivalent of blkg_policy_data for blkcg dedicated
>    data structures.
> . It adds to the blkcg_policy structure, i.e., to the descriptor of a policy, a
>    cpd_size field and a cpd_init field, to be initialized by the policy with,
>    respectively, the size of the blkcg dedicated data structures, and the
>    address of a constructor function for blkcg dedicated data structures.
> . It moves the CFQ-specific fields embedded in the blkcg data structure (i.e.,
>    the fields related to the proportional-share policy), into a new blkcg
>    dedicated data structure called cfq_group_data.

Applied, thanks.

-- 
Jens Axboe


      parent reply	other threads:[~2015-06-07 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 21:38 [PATCH] block, cgroup: implement policy-specific per-blkcg data Arianna Avanzini
2015-06-06  1:58 ` Tejun Heo
2015-06-07 14:10 ` Jens Axboe [this message]

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=557450DD.3080302@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=avanzini.arianna@gmail.com \
    --cc=axboe@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.valente@unimore.it \
    --cc=tj@kernel.org \
    /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