linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Shaohua Li <shli@fb.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH 2/2] raid5-cache: correctly handle stripe with enough journal space
Date: Wed, 06 Jan 2016 12:54:28 +1100	[thread overview]
Message-ID: <871t9vxyjv.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <8bafb456f68b960bebaff8b742021d565554d5d4.1451954517.git.shli@fb.com>

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

On Tue, Jan 05 2016, Shaohua Li wrote:

> If there are spaces in journal, we do nothing. Likely a typo merging
> recent io_unit mempool patch.

Very likely.

I think the same effect as your patch can be achieved with

diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 55a905e56e8a..6d2b4789a928 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -500,7 +500,7 @@ int r5l_write_stripe(struct r5l_log *log, struct stripe_head *sh)
 		spin_unlock(&log->no_space_stripes_lock);
 
 		r5l_wake_reclaim(log, reserve);
-
+	} else {
 		ret = r5l_log_stripe(log, sh, data_pages, parity_pages);
 		if (ret) {
 			spin_lock_irq(&log->io_list_lock);

Are you OK with me just merging that into the offending patch?

Thanks,
NeilBrown

>
> Signed-off-by: Shaohua Li <shli@fb.com>
> ---
>  drivers/md/raid5-cache.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
> index 55a905e..d242a36 100644
> --- a/drivers/md/raid5-cache.c
> +++ b/drivers/md/raid5-cache.c
> @@ -494,19 +494,19 @@ int r5l_write_stripe(struct r5l_log *log, struct stripe_head *sh)
>  	mutex_lock(&log->io_mutex);
>  	/* meta + data */
>  	reserve = (1 + write_disks) << (PAGE_SHIFT - 9);
> -	if (!r5l_has_free_space(log, reserve)) {
> -		spin_lock(&log->no_space_stripes_lock);
> -		list_add_tail(&sh->log_list, &log->no_space_stripes);
> -		spin_unlock(&log->no_space_stripes_lock);
> -
> -		r5l_wake_reclaim(log, reserve);
> -
> +	if (r5l_has_free_space(log, reserve)) {
>  		ret = r5l_log_stripe(log, sh, data_pages, parity_pages);
>  		if (ret) {
>  			spin_lock_irq(&log->io_list_lock);
>  			list_add_tail(&sh->log_list, &log->no_mem_stripes);
>  			spin_unlock_irq(&log->io_list_lock);
>  		}
> +	} else {
> +		spin_lock(&log->no_space_stripes_lock);
> +		list_add_tail(&sh->log_list, &log->no_space_stripes);
> +		spin_unlock(&log->no_space_stripes_lock);
> +
> +		r5l_wake_reclaim(log, reserve);
>  	}
>  
>  	mutex_unlock(&log->io_mutex);
> -- 
> 2.4.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

  reply	other threads:[~2016-01-06  1:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05  0:43 [PATCH 1/2] raid5-cache: destroy mempool Shaohua Li
2016-01-05  0:43 ` [PATCH 2/2] raid5-cache: correctly handle stripe with enough journal space Shaohua Li
2016-01-06  1:54   ` NeilBrown [this message]
2016-01-06  1:55     ` Shaohua Li
2016-01-06  1:50 ` [PATCH 1/2] raid5-cache: destroy mempool 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=871t9vxyjv.fsf@notabene.neil.brown.name \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@fb.com \
    /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).