The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [patch] raid5_end_write_request spinlock fix
@ 2006-04-21 12:59 Qi Yong
  2006-04-22  5:45 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Qi Yong @ 2006-04-21 12:59 UTC (permalink / raw)
  To: akpm; +Cc: neilb, linux-kernel

Hello,

Reduce the raid5_end_write_request() spinlock window.

Signed-off-by: Coywolf Qi Hunt <qiyong@fc-cn.com>
---

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 3184360..9c24377 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -581,7 +581,6 @@ static int raid5_end_write_request (stru
  	struct stripe_head *sh = bi->bi_private;
 	raid5_conf_t *conf = sh->raid_conf;
 	int disks = sh->disks, i;
-	unsigned long flags;
 	int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
 
 	if (bi->bi_size)
@@ -599,16 +598,14 @@ static int raid5_end_write_request (stru
 		return 0;
 	}
 
-	spin_lock_irqsave(&conf->device_lock, flags);
 	if (!uptodate)
 		md_error(conf->mddev, conf->disks[i].rdev);
 
 	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
-	
 	clear_bit(R5_LOCKED, &sh->dev[i].flags);
 	set_bit(STRIPE_HANDLE, &sh->state);
-	__release_stripe(conf, sh);
-	spin_unlock_irqrestore(&conf->device_lock, flags);
+	release_stripe(sh);
+
 	return 0;
 }
 

-- 
Coywolf Qi Hunt

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] raid5_end_write_request spinlock fix
  2006-04-21 12:59 [patch] raid5_end_write_request spinlock fix Qi Yong
@ 2006-04-22  5:45 ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2006-04-22  5:45 UTC (permalink / raw)
  To: Qi Yong; +Cc: akpm, linux-kernel

On Friday April 21, qiyong@fc-cn.com wrote:
> Hello,
> 
> Reduce the raid5_end_write_request() spinlock window.

Thank you for reviewing the md code and suggesting improvements.
However it would help if you used a few more words to describe your
patches.  E.g. explain why  you are convinced that it is safe to
reduce the range of the lock like this.

NeilBrown

> 
> Signed-off-by: Coywolf Qi Hunt <qiyong@fc-cn.com>
> ---
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 3184360..9c24377 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -581,7 +581,6 @@ static int raid5_end_write_request (stru
>   	struct stripe_head *sh = bi->bi_private;
>  	raid5_conf_t *conf = sh->raid_conf;
>  	int disks = sh->disks, i;
> -	unsigned long flags;
>  	int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
>  
>  	if (bi->bi_size)
> @@ -599,16 +598,14 @@ static int raid5_end_write_request (stru
>  		return 0;
>  	}
>  
> -	spin_lock_irqsave(&conf->device_lock, flags);
>  	if (!uptodate)
>  		md_error(conf->mddev, conf->disks[i].rdev);
>  
>  	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
> -	
>  	clear_bit(R5_LOCKED, &sh->dev[i].flags);
>  	set_bit(STRIPE_HANDLE, &sh->state);
> -	__release_stripe(conf, sh);
> -	spin_unlock_irqrestore(&conf->device_lock, flags);
> +	release_stripe(sh);
> +
>  	return 0;
>  }
>  
> 
> -- 
> Coywolf Qi Hunt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-22 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-21 12:59 [patch] raid5_end_write_request spinlock fix Qi Yong
2006-04-22  5:45 ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox