linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* md/raid1:!conf->r1buf_pool is unlikely in function   sync_request.
@ 2012-03-28 11:24 majianpeng
  2012-04-02  1:00 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2012-03-28 11:24 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

From 7f9446682f64e28106dd52cd12bdf74a19fb4015 Mon Sep 17 00:00:00 2001
From: majianpeng <majianpeng@gmail.com>
Date: Wed, 28 Mar 2012 19:20:07 +0800
Subject: [PATCH] md/raid1:!conf->r1buf_pool is unlikely in function
 sync_request.


Signed-off-by: majianpeng <majianpeng@gmail.com>
---
 drivers/md/raid1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4a40a20..943b3b3 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2246,7 +2246,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
 	int good_sectors = RESYNC_SECTORS;
 	int min_bad = 0; /* number of sectors that are bad in all devices */
 
-	if (!conf->r1buf_pool)
+	if (unlikely(!conf->r1buf_pool))
 		if (init_resync(conf))
 			return 0;
 
-- 
1.7.5.4

 				
--------------
majianpeng
2012-03-28


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

* Re: md/raid1:!conf->r1buf_pool is unlikely in function   sync_request.
  2012-03-28 11:24 md/raid1:!conf->r1buf_pool is unlikely in function sync_request majianpeng
@ 2012-04-02  1:00 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-04-02  1:00 UTC (permalink / raw)
  To: majianpeng; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

On Wed, 28 Mar 2012 19:24:29 +0800 "majianpeng" <majianpeng@gmail.com> wrote:

> >From 7f9446682f64e28106dd52cd12bdf74a19fb4015 Mon Sep 17 00:00:00 2001
> From: majianpeng <majianpeng@gmail.com>
> Date: Wed, 28 Mar 2012 19:20:07 +0800
> Subject: [PATCH] md/raid1:!conf->r1buf_pool is unlikely in function
>  sync_request.
> 
> 
> Signed-off-by: majianpeng <majianpeng@gmail.com>
> ---
>  drivers/md/raid1.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 4a40a20..943b3b3 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2246,7 +2246,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
>  	int good_sectors = RESYNC_SECTORS;
>  	int min_bad = 0; /* number of sectors that are bad in all devices */
>  
> -	if (!conf->r1buf_pool)
> +	if (unlikely(!conf->r1buf_pool))
>  		if (init_resync(conf))
>  			return 0;
>  

Hi,
 I'm really happy that you are reviewing the md patches and even finding some
 bugs.  However I find the stream of occasional tiny patches somewhat
 distracting.

 Also I find micro-optimisation like this fairly pointless.  You should only
 really use unlikely() when it will make a real difference to performance,
 and this change won't

 So I won't apply this patch.
 I'll keep looking though the others you have sent since but in future I
 would prefer it if you collected together little patches like this and send
 them as a group.

 If and when you find genuine bugs, feel free to send them straight away.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2012-04-02  1:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-28 11:24 md/raid1:!conf->r1buf_pool is unlikely in function sync_request majianpeng
2012-04-02  1:00 ` NeilBrown

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).