31 May, 2012

1 commit

  • Calling get_task_io_context() on a exiting task which isn't %current can
    loop forever. This triggers at boot time on my dev machine.

    BUG: soft lockup - CPU#3 stuck for 22s ! [mountall.1603]

    Fix this by making create_task_io_context() returns -EBUSY in this case
    to break the loop.

    Signed-off-by: Eric Dumazet
    Cc: Tejun Heo
    Cc: Andrew Morton
    Cc: Alan Cox
    Signed-off-by: Jens Axboe

    Eric Dumazet
     

30 May, 2012

1 commit

  • Merge block/IO core bits from Jens Axboe:
    "This is a bit bigger on the core side than usual, but that is purely
    because we decided to hold off on parts of Tejun's submission on 3.4
    to give it a bit more time to simmer. As a consequence, it's seen a
    long cycle in for-next.

    It contains:

    - Bug fix from Dan, wrong locking type.
    - Relax splice gifting restriction from Eric.
    - A ton of updates from Tejun, primarily for blkcg. This improves
    the code a lot, making the API nicer and cleaner, and also includes
    fixes for how we handle and tie policies and re-activate on
    switches. The changes also include generic bug fixes.
    - A simple fix from Vivek, along with a fix for doing proper delayed
    allocation of the blkcg stats."

    Fix up annoying conflict just due to different merge resolution in
    Documentation/feature-removal-schedule.txt

    * 'for-3.5/core' of git://git.kernel.dk/linux-block: (92 commits)
    blkcg: tg_stats_alloc_lock is an irq lock
    vmsplice: relax alignement requirements for SPLICE_F_GIFT
    blkcg: use radix tree to index blkgs from blkcg
    blkcg: fix blkcg->css ref leak in __blkg_lookup_create()
    block: fix elvpriv allocation failure handling
    block: collapse blk_alloc_request() into get_request()
    blkcg: collapse blkcg_policy_ops into blkcg_policy
    blkcg: embed struct blkg_policy_data in policy specific data
    blkcg: mass rename of blkcg API
    blkcg: style cleanups for blk-cgroup.h
    blkcg: remove blkio_group->path[]
    blkcg: blkg_rwstat_read() was missing inline
    blkcg: shoot down blkgs if all policies are deactivated
    blkcg: drop stuff unused after per-queue policy activation update
    blkcg: implement per-queue policy activation
    blkcg: add request_queue->root_blkg
    blkcg: make request_queue bypassing on allocation
    blkcg: make sure blkg_lookup() returns %NULL if @q is bypassing
    blkcg: make blkg_conf_prep() take @pol and return with queue lock held
    blkcg: remove static policy ID enums
    ...

    Linus Torvalds
     

23 May, 2012

2 commits

  • tg_stats_alloc_lock nests inside queue lock and should always be held
    with irq disabled. throtl_pd_{init|exit}() were using non-irqsafe
    spinlock ops which triggered inverse lock ordering via irq warning via
    RCU freeing of blkg invoking throtl_pd_exit() w/o disabling IRQ.

    Update both functions to use irq safe operations.

    Signed-off-by: Tejun Heo
    Reported-by: Sasha Levin
    LKML-Reference:
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Pull cgroup updates from Tejun Heo:
    "cgroup file type addition / removal is updated so that file types are
    added and removed instead of individual files so that dynamic file
    type addition / removal can be implemented by cgroup and used by
    controllers. blkio controller changes which will come through block
    tree are dependent on this. Other changes include res_counter cleanup
    and disallowing kthread / PF_THREAD_BOUND threads to be attached to
    non-root cgroups.

    There's a reported bug with the file type addition / removal handling
    which can lead to oops on cgroup umount. The issue is being looked
    into. It shouldn't cause problems for most setups and isn't a
    security concern."

    Fix up trivial conflict in Documentation/feature-removal-schedule.txt

    * 'for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (21 commits)
    res_counter: Account max_usage when calling res_counter_charge_nofail()
    res_counter: Merge res_counter_charge and res_counter_charge_nofail
    cgroups: disallow attaching kthreadd or PF_THREAD_BOUND threads
    cgroup: remove cgroup_subsys->populate()
    cgroup: get rid of populate for memcg
    cgroup: pass struct mem_cgroup instead of struct cgroup to socket memcg
    cgroup: make css->refcnt clearing on cgroup removal optional
    cgroup: use negative bias on css->refcnt to block css_tryget()
    cgroup: implement cgroup_rm_cftypes()
    cgroup: introduce struct cfent
    cgroup: relocate __d_cgrp() and __d_cft()
    cgroup: remove cgroup_add_file[s]()
    cgroup: convert memcg controller to the new cftype interface
    memcg: always create memsw files if CONFIG_CGROUP_MEM_RES_CTLR_SWAP
    cgroup: convert all non-memcg controllers to the new cftype interface
    cgroup: relocate cftype and cgroup_subsys definitions in controllers
    cgroup: merge cft_release_agent cftype array into the base files array
    cgroup: implement cgroup_add_cftypes() and friends
    cgroup: build list of all cgroups under a given cgroupfs_root
    cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir()
    ...

    Linus Torvalds
     

22 May, 2012

1 commit

  • Pull s390 updates from Martin Schwidefsky:
    "Just a random collection of bug-fixes and cleanups, nothing new in
    this merge request."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (46 commits)
    s390/ap: Fix wrong or missing comments
    s390/ap: move receive callback to message struct
    s390/dasd: re-prioritize partition detection message
    s390/qeth: reshuffle initialization
    s390/qeth: cleanup drv attr usage
    s390/claw: cleanup drv attr usage
    s390/lcs: cleanup drv attr usage
    s390/ctc: cleanup drv attr usage
    s390/ccwgroup: remove ccwgroup_create_from_string
    s390/qeth: stop using struct ccwgroup driver for discipline callbacks
    s390/qeth: switch to ccwgroup_create_dev
    s390/claw: switch to ccwgroup_create_dev
    s390/lcs: switch to ccwgroup_create_dev
    s390/ctcm: switch to ccwgroup_create_dev
    s390/ccwgroup: exploit ccwdev_by_dev_id
    s390/ccwgroup: introduce ccwgroup_create_dev
    s390: fix race on TIF_MCCK_PENDING
    s390/barrier: make use of fast-bcr facility
    s390/barrier: cleanup barrier functions
    s390/claw: remove "eieio" calls
    ...

    Linus Torvalds
     

16 May, 2012

1 commit


15 May, 2012

1 commit

  • 6d1d8050b4bc8 "block, partition: add partition_meta_info to hd_struct"
    added part_unpack_uuid() which assumes that the passed in buffer has
    enough space for sprintfing "%pU" - 37 characters including '\0'.

    Unfortunately, b5af921ec0233 "init: add support for root devices
    specified by partition UUID" supplied 33 bytes buffer to the function
    leading to the following panic with stackprotector enabled.

    Kernel panic - not syncing: stack-protector: Kernel stack corrupted in: ffffffff81b14c7e

    [] panic+0xba/0x1c6
    [] ? printk_all_partitions+0x259/0x26xb
    [] __stack_chk_fail+0x1b/0x20
    [] printk_all_paritions+0x259/0x26xb
    [] mount_block_root+0x1bc/0x27f
    [] mount_root+0x57/0x5b
    [] prepare_namespace+0x13d/0x176
    [] ? release_tgcred.isra.4+0x330/0x30
    [] kernel_init+0x155/0x15a
    [] ? schedule_tail+0x27/0xb0
    [] kernel_thread_helper+0x5/0x10
    [] ? start_kernel+0x3c5/0x3c5
    [] ? gs_change+0x13/0x13

    Increase the buffer size, remove the dangerous part_unpack_uuid() and
    use snprintf() directly from printk_all_partitions().

    Signed-off-by: Tejun Heo
    Reported-by: Szymon Gruszczynski
    Cc: Will Drewry
    Cc: stable@vger.kernel.org
    Signed-off-by: Jens Axboe

    Tejun Heo
     

01 May, 2012

1 commit


20 Apr, 2012

21 commits

  • blkg lookup is currently performed by traversing linked list anchored
    at blkcg->blkg_list. This is very unscalable and with blk-throttle
    enabled and enough request queues on the system, this can get very
    ugly quickly (blk-throttle performs look up on every bio submission).

    This patch makes blkcg use radix tree to index blkgs combined with
    simple last-looked-up hint. This is mostly identical to how icqs are
    indexed from ioc.

    Note that because __blkg_lookup() may be invoked without holding queue
    lock, hint is only updated from __blkg_lookup_create(). Due to cfq's
    cfqq caching, this makes hint updates overly lazy. This will be
    improved with scheduled blkcg aware request allocation.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • __blkg_lookup_create() leaked blkcg->css ref if blkg allocation
    failed. Fix it.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Request allocation is mempool backed to guarantee forward progress
    under memory pressure; unfortunately, this property got broken while
    adding elvpriv data. Failures during elvpriv allocation, including
    ioc and icq creation failures, currently make get_request() fail as
    whole. There's no forward progress guarantee for these allocations -
    they may fail indefinitely under memory pressure stalling IO and
    deadlocking the system.

    This patch updates get_request() such that elvpriv allocation failure
    doesn't make the whole function fail. If elvpriv allocation fails,
    the allocation is degraded into !ELVPRIV. This will force the request
    to ELEVATOR_INSERT_BACK disturbing scheduling but elvpriv alloc
    failures should be rare (nothing is per-request) and anything is
    better than deadlocking.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Allocation failure handling in get_request() is about to be updated.
    To ease the update, collapse blk_alloc_request() into get_request().

    This patch doesn't introduce any functional change.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • There's no reason to keep blkcg_policy_ops separate. Collapse it into
    blkcg_policy.

    This patch doesn't introduce any functional change.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Currently blkg_policy_data carries policy specific data as char flex
    array instead of being embedded in policy specific data. This was
    forced by oddities around blkg allocation which are all gone now.

    This patch makes blkg_policy_data embedded in policy specific data -
    throtl_grp and cfq_group so that it's more conventional and consistent
    with how io_cq is handled.

    * blkcg_policy->pdata_size is renamed to ->pd_size.

    * Functions which used to take void *pdata now takes struct
    blkg_policy_data *pd.

    * blkg_to_pdata/pdata_to_blkg() updated to blkg_to_pd/pd_to_blkg().

    * Dummy struct blkg_policy_data definition added. Dummy
    pdata_to_blkg() definition was unused and inconsistent with the
    non-dummy version - correct dummy pd_to_blkg() added.

    * throtl and cfq updated accordingly.

    * As dummy blkg_to_pd/pd_to_blkg() are provided,
    blkg_to_cfqg/cfqg_to_blkg() don't need to be ifdef'd. Moved outside
    ifdef block.

    This patch doesn't introduce any functional change.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • During the recent blkcg cleanup, most of blkcg API has changed to such
    extent that mass renaming wouldn't cause any noticeable pain. Take
    the chance and cleanup the naming.

    * Rename blkio_cgroup to blkcg.

    * Drop blkio / blkiocg prefixes and consistently use blkcg.

    * Rename blkio_group to blkcg_gq, which is consistent with io_cq but
    keep the blkg prefix / variable name.

    * Rename policy method type and field names to signify they're dealing
    with policy data.

    * Rename blkio_policy_type to blkcg_policy.

    This patch doesn't cause any functional change.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • * Update indentation on struct field declarations.

    * Uniformly don't use "extern" on function declarations.

    * Merge the two #ifdef CONFIG_BLK_CGROUP blocks.

    All changes in this patch are cosmetic.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • blkio_group->path[] stores the path of the associated cgroup and is
    used only for debug messages. Just format the path from blkg->cgroup
    when printing debug messages.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • blkg_rwstat_read() in blk-cgroup.h was missing inline modifier causing
    compile warning depending on configuration. Add it.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • There's no reason to keep blkgs around if no policy is activated for
    the queue. This patch moves queue locking out of blkg_destroy_all()
    and call it from blkg_deactivate_policy() on deactivation of the last
    policy on the queue.

    This change was suggested by Vivek.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • * All_q_list is unused. Drop all_q_{mutex|list}.

    * @for_root of blkg_lookup_create() is always %false when called from
    outside blk-cgroup.c proper. Factor out __blkg_lookup_create() so
    that it doesn't check whether @q is bypassing and use the
    underscored version for the @for_root callsite.

    * blkg_destroy_all() is used only from blkcg proper and @destroy_root
    is always %true. Make it static and drop @destroy_root.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • All blkcg policies were assumed to be enabled on all request_queues.
    Due to various implementation obstacles, during the recent blkcg core
    updates, this was temporarily implemented as shooting down all !root
    blkgs on elevator switch and policy [de]registration combined with
    half-broken in-place root blkg updates. In addition to being buggy
    and racy, this meant losing all blkcg configurations across those
    events.

    Now that blkcg is cleaned up enough, this patch replaces the temporary
    implementation with proper per-queue policy activation. Each blkcg
    policy should call the new blkcg_[de]activate_policy() to enable and
    disable the policy on a specific queue. blkcg_activate_policy()
    allocates and installs policy data for the policy for all existing
    blkgs. blkcg_deactivate_policy() does the reverse. If a policy is
    not enabled for a given queue, blkg printing / config functions skip
    the respective blkg for the queue.

    blkcg_activate_policy() also takes care of root blkg creation, and
    cfq_init_queue() and blk_throtl_init() are updated accordingly.

    This replaces blkcg_bypass_{start|end}() and update_root_blkg_pd()
    unnecessary. Dropped.

    v2: cfq_init_queue() was returning uninitialized @ret on root_group
    alloc failure if !CONFIG_CFQ_GROUP_IOSCHED. Fixed.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With per-queue policy activation, root blkg creation will be moved to
    blkcg core. Add q->root_blkg in preparation. For blk-throtl, this
    replaces throtl_data->root_tg; however, cfq needs to keep
    cfqd->root_group for !CONFIG_CFQ_GROUP_IOSCHED.

    This is to prepare for per-queue policy activation and doesn't cause
    any functional difference.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With the previous change to guarantee bypass visiblity for RCU read
    lock regions, entering bypass mode involves non-trivial overhead and
    future changes are scheduled to make use of bypass mode during init
    path. Combined it may end up adding noticeable delay during boot.

    This patch makes request_queue start its life in bypass mode, which is
    ended on queue init completion at the end of
    blk_init_allocated_queue(), and updates blk_queue_bypass_start() such
    that draining and RCU synchronization are performed only when the
    queue actually enters bypass mode.

    This avoids unnecessarily switching in and out of bypass mode during
    init avoiding the overhead and any nasty surprises which may step from
    leaving bypass mode on half-initialized queues.

    The boot time overhead was pointed out by Vivek.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Currently, blkg_lookup() doesn't check @q bypass state. This patch
    updates blk_queue_bypass_start() to do synchronize_rcu() before
    returning and updates blkg_lookup() to check blk_queue_bypass() and
    return %NULL if bypassing. This ensures blkg_lookup() returns %NULL
    if @q is bypassing.

    This is to guarantee that nobody is accessing policy data while @q is
    bypassing, which is necessary to allow replacing blkio_cgroup->pd[] in
    place on policy [de]activation.

    v2: Added more comments explaining bypass guarantees as suggested by
    Vivek.

    v3: Added more comments explaining why there's no synchronize_rcu() in
    blk_cleanup_queue() as suggested by Vivek.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Add @pol to blkg_conf_prep() and let it return with queue lock held
    (to be released by blkg_conf_finish()). Note that @pol isn't used
    yet.

    This is to prepare for per-queue policy activation and doesn't cause
    any visible difference.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • Remove BLKIO_POLICY_* enums and let blkio_policy_register() allocate
    @pol->plid dynamically on registration. The maximum number of blkcg
    policies which can be registered at the same time is defined by
    BLKCG_MAX_POLS constant added to include/linux/blkdev.h.

    Note that blkio_policy_register() now may fail. Policy init functions
    updated accordingly and unnecessary ifdefs removed from cfq_init().

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • The two functions were taking "enum blkio_policy_id plid". Make them
    take "const struct blkio_policy_type *pol" instead.

    This is to prepare for per-queue policy activation and doesn't cause
    any functional difference.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With blkio_policy[], blkio_list is redundant and hinders with
    per-queue policy activation. Remove it. Also, replace
    blkio_list_lock with a mutex blkcg_pol_mutex and let it protect the
    whole [un]registration.

    This is to prepare for per-queue policy activation and doesn't cause
    any functional difference.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • * CFQ_WEIGHT_* defined inside CONFIG_BLK_CGROUP causes cfq-iosched.c
    compile failure when the config is disabled. Move it outside the
    ifdef block.

    * Dummy cfqg_stats_*() definitions were lacking inline modifiers
    causing unused functions warning if !CONFIG_CFQ_GROUP_IOSCHED. Add
    them.

    Signed-off-by: Tejun Heo
    Cc: Vivek Goyal
    Signed-off-by: Jens Axboe

    Tejun Heo
     

14 Apr, 2012

1 commit

  • Pull block core bits from Jens Axboe:
    "It's a nice and quiet round this time, since most of the tricky stuff
    has been pushed to 3.5 to give it more time to mature. After a few
    hectic block IO core changes for 3.3 and 3.2, I'm quite happy with a
    slow round.

    Really minor stuff in here, the only real functional change is making
    the auto-unplug threshold a per-queue entity. The threshold is set so
    that it's low enough that we don't hold off IO for too long, but still
    big enough to get a nice benefit from the batched insert (and hence
    queue lock cost reduction). For raid configurations, this currently
    breaks down."

    * 'for-3.4/core' of git://git.kernel.dk/linux-block:
    block: make auto block plug flush threshold per-disk based
    Documentation: Add sysfs ABI change for cfq's target latency.
    block: Make cfq_target_latency tunable through sysfs.
    block: use lockdep_assert_held for queue locking
    block: blk_alloc_queue_node(): use caller's GFP flags instead of GFP_KERNEL

    Linus Torvalds
     

07 Apr, 2012

1 commit

  • We do auto block plug flush to reduce latency, the threshold is 16
    requests. This works well if the task is accessing one or two drives.
    The problem is if the task is accessing a raid 0 device and the raid
    disk number is big, say 8 or 16, 16/8 = 2 or 16/16=1, we will have
    heavy lock contention.

    This patch makes the threshold per-disk based. The latency should be
    still ok accessing one or two drives. The setup with application
    accessing a lot of drives in the meantime uaually is big machine,
    avoiding lock contention is more important, because any contention
    will actually increase latency.

    Signed-off-by: Shaohua Li
    Signed-off-by: Jens Axboe

    Shaohua Li
     

02 Apr, 2012

9 commits

  • Now that all stat handling code lives in policy implementations,
    there's no need to encode policy ID in cft->private.

    * Export blkcg_prfill_[rw]stat() from blkcg, remove
    blkcg_print_[rw]stat(), and implement cfqg_print_[rw]stat() which
    use hard-code BLKIO_POLICY_PROP.

    * Use cft->private for offset of the target field directly and drop
    BLKCG_STAT_{PRIV|POL|OFF}().

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Now that all conf and stat fields are moved into policy specific
    blkio_policy_data->pdata areas, there's no reason to use
    blkio_policy_data itself in prfill functions. Pass around @pd->pdata
    instead of @pd.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • blkio_cgroup_conf->iops and ->bps are owned by blk-throttle and has no
    reason to be defined in blkcg core. Drop them and let conf setting
    functions directly manipulate throtl_grp->bps[] and ->iops[].

    This makes blkio_group_conf empty. Drop it.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • blkio_group_conf->weight is owned by cfq and has no reason to be
    defined in blkcg core. Replace it with cfq_group->dev_weight and let
    conf setting functions directly set it. If dev_weight is zero, the
    cfqg doesn't have device specific weight configured.

    Also, rename BLKIO_WEIGHT_* constants to CFQ_WEIGHT_* and rename
    blkio_cgroup->weight to blkio_cgroup->cfq_weight. We eventually want
    per-policy storage in blkio_cgroup but just mark the ownership of the
    field for now.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • blkio_group_stats_cpu is used only by blk-throtl and has no reason to
    be defined in blkcg core.

    * Move blkio_group_stats_cpu to blk-throttle.c and rename it to
    tg_stats_cpu.

    * blkg_policy_data->stats_cpu is replaced with throtl_grp->stats_cpu.
    prfill functions updated accordingly.

    * All related macros / functions are renamed so that they have tg_
    prefix and the unnecessary @pol arguments are dropped.

    * Per-cpu stats allocation code is also moved from blk-cgroup.c to
    blk-throttle.c and gets simplified to only deal with
    BLKIO_POLICY_THROTL. percpu stat free is performed by the exit
    method throtl_exit_blkio_group().

    * throtl_reset_group_stats() implemented for
    blkio_reset_group_stats_fn method so that tg->stats_cpu can be
    reset.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • blkio_group_stats contains only fields used by cfq and has no reason
    to be defined in blkcg core.

    * Move blkio_group_stats to cfq-iosched.c and rename it to cfqg_stats.

    * blkg_policy_data->stats is replaced with cfq_group->stats.
    blkg_prfill_[rw]stat() are updated to use offset against pd->pdata
    instead.

    * All related macros / functions are renamed so that they have cfqg_
    prefix and the unnecessary @pol arguments are dropped.

    * All stat functions now take cfq_group * instead of blkio_group *.

    * lockdep assertion on queue lock dropped. Elevator runs under queue
    lock by default. There isn't much to be gained by adding lockdep
    assertions at stat function level.

    * cfqg_stats_reset() implemented for blkio_reset_group_stats_fn method
    so that cfqg->stats can be reset.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Add blkio_policy_ops->blkio_exit_group_fn() and
    ->blkio_reset_group_stats_fn(). These will be used to further
    modularize blkcg policy implementation.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • blkio_group_stats_cpu is used to count dispatch stats using per-cpu
    counters. This is used by both blk-throtl and cfq-iosched but the
    sharing is rather silly.

    * cfq-iosched doesn't need per-cpu dispatch stats. cfq always updates
    those stats while holding queue_lock.

    * blk-throtl needs per-cpu dispatch stats but only service_bytes and
    serviced. It doesn't make use of sectors.

    This patch makes cfq add and use global stats for service_bytes,
    serviced and sectors, removes per-cpu sectors counter and moves
    per-cpu stat printing code to blk-throttle.c.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • As with conf/stats file handling code, there's no reason for stat
    update code to live in blkcg core with policies calling into update
    them. The current organization is both inflexible and complex.

    This patch moves stat update code to specific policies. All
    blkiocg_update_*_stats() functions which deal with BLKIO_POLICY_PROP
    stats are collapsed into their cfq_blkiocg_update_*_stats()
    counterparts. blkiocg_update_dispatch_stats() is used by both
    policies and duplicated as throtl_update_dispatch_stats() and
    cfq_blkiocg_update_dispatch_stats(). This will be cleaned up later.

    Signed-off-by: Tejun Heo

    Tejun Heo