* [PATCH 1/2] raid5-cache: destroy mempool @ 2016-01-05 0:43 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:50 ` [PATCH 1/2] raid5-cache: destroy mempool NeilBrown 0 siblings, 2 replies; 5+ messages in thread From: Shaohua Li @ 2016-01-05 0:43 UTC (permalink / raw) To: linux-raid; +Cc: neilb io_unit mempool isn't destroied with recent changes. Signed-off-by: Shaohua Li <shli@fb.com> --- drivers/md/raid5-cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index d992d62..55a905e 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -1257,6 +1257,7 @@ void r5l_exit_log(struct r5l_log *log) md_unregister_thread(&log->reclaim_thread); mempool_destroy(log->meta_pool); bioset_free(log->bs); + mempool_destroy(log->io_pool); kmem_cache_destroy(log->io_kc); kfree(log); } -- 2.4.6 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] raid5-cache: correctly handle stripe with enough journal space 2016-01-05 0:43 [PATCH 1/2] raid5-cache: destroy mempool Shaohua Li @ 2016-01-05 0:43 ` Shaohua Li 2016-01-06 1:54 ` NeilBrown 2016-01-06 1:50 ` [PATCH 1/2] raid5-cache: destroy mempool NeilBrown 1 sibling, 1 reply; 5+ messages in thread From: Shaohua Li @ 2016-01-05 0:43 UTC (permalink / raw) To: linux-raid; +Cc: neilb If there are spaces in journal, we do nothing. Likely a typo merging recent io_unit mempool patch. 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 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] raid5-cache: correctly handle stripe with enough journal space 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 2016-01-06 1:55 ` Shaohua Li 0 siblings, 1 reply; 5+ messages in thread From: NeilBrown @ 2016-01-06 1:54 UTC (permalink / raw) To: Shaohua Li, linux-raid [-- 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 --] ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] raid5-cache: correctly handle stripe with enough journal space 2016-01-06 1:54 ` NeilBrown @ 2016-01-06 1:55 ` Shaohua Li 0 siblings, 0 replies; 5+ messages in thread From: Shaohua Li @ 2016-01-06 1:55 UTC (permalink / raw) To: NeilBrown; +Cc: linux-raid On Wed, Jan 06, 2016 at 12:54:28PM +1100, NeilBrown wrote: > 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? sure, please go ahead ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] raid5-cache: destroy mempool 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:50 ` NeilBrown 1 sibling, 0 replies; 5+ messages in thread From: NeilBrown @ 2016-01-06 1:50 UTC (permalink / raw) To: Shaohua Li, linux-raid [-- Attachment #1: Type: text/plain, Size: 750 bytes --] On Tue, Jan 05 2016, Shaohua Li wrote: > io_unit mempool isn't destroied with recent changes. > > Signed-off-by: Shaohua Li <shli@fb.com> > --- > drivers/md/raid5-cache.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c > index d992d62..55a905e 100644 > --- a/drivers/md/raid5-cache.c > +++ b/drivers/md/raid5-cache.c > @@ -1257,6 +1257,7 @@ void r5l_exit_log(struct r5l_log *log) > md_unregister_thread(&log->reclaim_thread); > mempool_destroy(log->meta_pool); > bioset_free(log->bs); > + mempool_destroy(log->io_pool); > kmem_cache_destroy(log->io_kc); > kfree(log); > } Thanks! I've merge that into the offending patch rather than adding it as a separate patch. NeilBrown [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 818 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-06 1:55 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2016-01-06 1:55 ` Shaohua Li 2016-01-06 1:50 ` [PATCH 1/2] raid5-cache: destroy mempool 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).