linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: NeilBrown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 001 of 4] md: Define backing_dev_info.congested_fn for raid0 and linear
Date: Mon, 28 Aug 2006 22:59:08 -0700	[thread overview]
Message-ID: <20060828225908.af114751.akpm@osdl.org> (raw)
In-Reply-To: <1060829053924.6610@suse.de>

On Tue, 29 Aug 2006 15:39:24 +1000
NeilBrown <neilb@suse.de> wrote:

> 
> Each backing_dev needs to be able to report whether it is congested,
> either by modulating BDI_*_congested in ->state, or by
> defining a ->congested_fn.
> md/raid did neither of these.  This patch add a congested_fn
> which simply checks all component devices to see if they are
> congested.
> 
> Signed-off-by: Neil Brown <neilb@suse.de>
> 
> +static int linear_congested(void *data, int bits)
> +{
> +	mddev_t *mddev = data;
> +	linear_conf_t *conf = mddev_to_conf(mddev);
> +	int i, ret = 0;
> +
> +	for (i = 0; i < mddev->raid_disks && !ret ; i++) {
> +		request_queue_t *q = bdev_get_queue(conf->disks[i].rdev->bdev);
> +		ret |= bdi_congested(&q->backing_dev_info, bits);

nit: `ret = ' would suffice here.

> +static int raid0_congested(void *data, int bits)
> +{
> +	mddev_t *mddev = data;
> +	raid0_conf_t *conf = mddev_to_conf(mddev);
> +	mdk_rdev_t **devlist = conf->strip_zone[0].dev;
> +	int i, ret = 0;
> +
> +	for (i = 0; i < mddev->raid_disks && !ret ; i++) {
> +		request_queue_t *q = bdev_get_queue(devlist[i]->bdev);
> +
> +		ret |= bdi_congested(&q->backing_dev_info, bits);

And here.

> +	}
> +	return ret;
> +}
> +
>  
>  static int create_strip_zones (mddev_t *mddev)
>  {
> @@ -236,6 +251,8 @@ static int create_strip_zones (mddev_t *
>  	mddev->queue->unplug_fn = raid0_unplug;
>  
>  	mddev->queue->issue_flush_fn = raid0_issue_flush;
> +	mddev->queue->backing_dev_info.congested_fn = raid0_congested;
> +	mddev->queue->backing_dev_info.congested_data = mddev;
>  
>  	printk("raid0: done.\n");
>  	return 0;

  reply	other threads:[~2006-08-29  5:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29  5:39 [PATCH 000 of 4] md: Introduction NeilBrown
2006-08-29  5:39 ` [PATCH 001 of 4] md: Define backing_dev_info.congested_fn for raid0 and linear NeilBrown
2006-08-29  5:59   ` Andrew Morton [this message]
2006-09-04  5:32     ` Neil Brown
2006-08-29  5:39 ` [PATCH 002 of 4] md: Define ->congested_fn for raid1, raid10, and multipath NeilBrown
2006-08-29  6:12   ` Jan Engelhardt
2006-08-29  5:39 ` [PATCH 003 of 4] md: Add a ->congested_fn function for raid5/6 NeilBrown
2006-08-29  5:39 ` [PATCH 004 of 4] md: Make messages about resync/recovery etc more specific NeilBrown

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=20060828225908.af114751.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).