lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 05 Nov 2009 13:35:22 +0800
From:	Gui Jianfeng <guijianfeng@...fujitsu.com>
To:	Vivek Goyal <vgoyal@...hat.com>
CC:	linux-kernel@...r.kernel.org, jens.axboe@...cle.com,
	nauman@...gle.com, dpshah@...gle.com, lizf@...fujitsu.com,
	ryov@...inux.co.jp, fernando@....ntt.co.jp, s-uchida@...jp.nec.com,
	taka@...inux.co.jp, jmoyer@...hat.com, balbir@...ux.vnet.ibm.com,
	righi.andrea@...il.com, m-ikeda@...jp.nec.com,
	akpm@...ux-foundation.org, riel@...hat.com,
	kamezawa.hiroyu@...fujitsu.com
Subject: Re: [PATCH 09/20] blkio: Porpogate blkio cgroup weight or ioprio
 class updation to cfq groups

Vivek Goyal wrote:
> o If a user decides the change the weight or ioprio class of a cgroup, this
>   information needs to be passed on to io controlling policy module also so
>   that new information can take effect.
> 
> Signed-off-by: Vivek Goyal <vgoyal@...hat.com>
> ---
>  block/blk-cgroup.c  |   16 ++++++++++++++++
>  block/cfq-iosched.c |   18 ++++++++++++++++++
>  2 files changed, 34 insertions(+), 0 deletions(-)
> 
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 7bde5c4..0d52a2c 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -13,6 +13,10 @@
>  #include <linux/ioprio.h>
>  #include "blk-cgroup.h"
>  
> +extern void cfq_update_blkio_group_weight(struct blkio_group *, unsigned int);
> +extern void cfq_update_blkio_group_ioprio_class(struct blkio_group *,
> +		unsigned short);
> +
>  struct blkio_cgroup blkio_root_cgroup = {
>  	.weight = BLKIO_WEIGHT_DEFAULT,
>  	.ioprio_class = IOPRIO_CLASS_BE,
> @@ -75,12 +79,18 @@ static int
>  blkiocg_weight_write(struct cgroup *cgroup, struct cftype *cftype, u64 val)
>  {
>  	struct blkio_cgroup *blkcg;
> +	struct blkio_group *blkg;
> +	struct hlist_node *n;
>  
>  	if (val < BLKIO_WEIGHT_MIN || val > BLKIO_WEIGHT_MAX)
>  		return -EINVAL;
>  
>  	blkcg = cgroup_to_blkio_cgroup(cgroup);
> +	spin_lock_irq(&blkcg->lock);
>  	blkcg->weight = (unsigned int)val;
> +	hlist_for_each_entry(blkg, n, &blkcg->blkg_list, blkcg_node)
> +		cfq_update_blkio_group_weight(blkg, blkcg->weight);
> +	spin_unlock_irq(&blkcg->lock);
>  	return 0;
>  }
>  
> @@ -88,12 +98,18 @@ static int blkiocg_ioprio_class_write(struct cgroup *cgroup,
>  					struct cftype *cftype, u64 val)
>  {
>  	struct blkio_cgroup *blkcg;
> +	struct blkio_group *blkg;
> +	struct hlist_node *n;
>  
>  	if (val < IOPRIO_CLASS_RT || val > IOPRIO_CLASS_IDLE)
>  		return -EINVAL;
>  
>  	blkcg = cgroup_to_blkio_cgroup(cgroup);
> +	spin_lock_irq(&blkcg->lock);
>  	blkcg->ioprio_class = (unsigned int)val;
> +	hlist_for_each_entry(blkg, n, &blkcg->blkg_list, blkcg_node)
> +		cfq_update_blkio_group_weight(blkg, blkcg->weight);

  Here should be cfq_update_blkio_group_ioprio_class()

Thanks 
Gui

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ