diff mbox series

[09/13] lightnvm: pblk: Kick writer for flush requests

Message ID 20190227171442.11853-10-igor.j.konopko@intel.com (mailing list archive)
State New, archived
Headers show
Series lightnvm: bugfixes and improvements | expand

Commit Message

Igor Konopko Feb. 27, 2019, 5:14 p.m. UTC
In case when there is no enough sector available in rwb
and there is flush request send we should kick write thread
which is not a case in current implementation. This patch
fixes that issue.

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
---
 drivers/lightnvm/pblk-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Javier González March 4, 2019, 8:08 a.m. UTC | #1
> On 27 Feb 2019, at 18.14, Igor Konopko <igor.j.konopko@intel.com> wrote:
> 
> In case when there is no enough sector available in rwb
> and there is flush request send we should kick write thread
> which is not a case in current implementation. This patch
> fixes that issue.
> 
> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
> ---
> drivers/lightnvm/pblk-core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> index 78b1eea4ab67..f48f2e77f770 100644
> --- a/drivers/lightnvm/pblk-core.c
> +++ b/drivers/lightnvm/pblk-core.c
> @@ -375,8 +375,9 @@ void pblk_write_timer_fn(struct timer_list *t)
> void pblk_write_should_kick(struct pblk *pblk)
> {
> 	unsigned int secs_avail = pblk_rb_read_count(&pblk->rwb);
> +	unsigned int secs_to_flush = pblk_rb_flush_point_count(&pblk->rwb);
> 
> -	if (secs_avail >= pblk->min_write_pgs_data)
> +	if (secs_avail >= pblk->min_write_pgs_data || secs_to_flush)
> 		pblk_write_kick(pblk);
> }
> 
> --
> 2.17.1

We already kick the write thread in case of REQ_PREFLUSH in
pblk_write_cache(), so no need to kick again.

Javier
Hans Holmberg March 4, 2019, 9:39 a.m. UTC | #2
On Mon, Mar 4, 2019 at 9:08 AM Javier González <javier@javigon.com> wrote:
>
>
> > On 27 Feb 2019, at 18.14, Igor Konopko <igor.j.konopko@intel.com> wrote:
> >
> > In case when there is no enough sector available in rwb
> > and there is flush request send we should kick write thread
> > which is not a case in current implementation. This patch
> > fixes that issue.
> >
> > Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
> > ---
> > drivers/lightnvm/pblk-core.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> > index 78b1eea4ab67..f48f2e77f770 100644
> > --- a/drivers/lightnvm/pblk-core.c
> > +++ b/drivers/lightnvm/pblk-core.c
> > @@ -375,8 +375,9 @@ void pblk_write_timer_fn(struct timer_list *t)
> > void pblk_write_should_kick(struct pblk *pblk)
> > {
> >       unsigned int secs_avail = pblk_rb_read_count(&pblk->rwb);
> > +     unsigned int secs_to_flush = pblk_rb_flush_point_count(&pblk->rwb);
> >
> > -     if (secs_avail >= pblk->min_write_pgs_data)
> > +     if (secs_avail >= pblk->min_write_pgs_data || secs_to_flush)
> >               pblk_write_kick(pblk);
> > }
> >
> > --
> > 2.17.1
>
> We already kick the write thread in case of REQ_PREFLUSH in
> pblk_write_cache(), so no need to kick again.

Yeah, I thought i fixed this issue in:

cc9c9a00b10e ("lightnvm: pblk: kick writer on new flush points")

That commit brought down the test time of some of the xfs sync tests
with a factor of 20 or so.

Igor: Have you seen any case of delayed syncs?

>
> Javier
Igor Konopko March 4, 2019, 12:52 p.m. UTC | #3
On 04.03.2019 10:39, Hans Holmberg wrote:
> On Mon, Mar 4, 2019 at 9:08 AM Javier González <javier@javigon.com> wrote:
>>
>>
>>> On 27 Feb 2019, at 18.14, Igor Konopko <igor.j.konopko@intel.com> wrote:
>>>
>>> In case when there is no enough sector available in rwb
>>> and there is flush request send we should kick write thread
>>> which is not a case in current implementation. This patch
>>> fixes that issue.
>>>
>>> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
>>> ---
>>> drivers/lightnvm/pblk-core.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
>>> index 78b1eea4ab67..f48f2e77f770 100644
>>> --- a/drivers/lightnvm/pblk-core.c
>>> +++ b/drivers/lightnvm/pblk-core.c
>>> @@ -375,8 +375,9 @@ void pblk_write_timer_fn(struct timer_list *t)
>>> void pblk_write_should_kick(struct pblk *pblk)
>>> {
>>>        unsigned int secs_avail = pblk_rb_read_count(&pblk->rwb);
>>> +     unsigned int secs_to_flush = pblk_rb_flush_point_count(&pblk->rwb);
>>>
>>> -     if (secs_avail >= pblk->min_write_pgs_data)
>>> +     if (secs_avail >= pblk->min_write_pgs_data || secs_to_flush)
>>>                pblk_write_kick(pblk);
>>> }
>>>
>>> --
>>> 2.17.1
>>
>> We already kick the write thread in case of REQ_PREFLUSH in
>> pblk_write_cache(), so no need to kick again.
> 
> Yeah, I thought i fixed this issue in:
> 
> cc9c9a00b10e ("lightnvm: pblk: kick writer on new flush points")
> 
> That commit brought down the test time of some of the xfs sync tests
> with a factor of 20 or so.
> 
> Igor: Have you seen any case of delayed syncs?

I didn't noticed that in the code. My mistake. So definitely my commit 
does not make a sense and we can just forget about that one.

> 
>>
>> Javier
diff mbox series

Patch

diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
index 78b1eea4ab67..f48f2e77f770 100644
--- a/drivers/lightnvm/pblk-core.c
+++ b/drivers/lightnvm/pblk-core.c
@@ -375,8 +375,9 @@  void pblk_write_timer_fn(struct timer_list *t)
 void pblk_write_should_kick(struct pblk *pblk)
 {
 	unsigned int secs_avail = pblk_rb_read_count(&pblk->rwb);
+	unsigned int secs_to_flush = pblk_rb_flush_point_count(&pblk->rwb);
 
-	if (secs_avail >= pblk->min_write_pgs_data)
+	if (secs_avail >= pblk->min_write_pgs_data || secs_to_flush)
 		pblk_write_kick(pblk);
 }