Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1743300

Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p

From Javier González <jg@lightnvm.io>
Newsgroups linux.kernel
Subject Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p
Date 2017-10-02 22:50 +0200
Message-ID <uwfPf-ur-229@gated-at.bofh.it> (permalink)
References <uvMtI-2Hh-15@gated-at.bofh.it> <uw7eO-6IZ-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

> On 2 Oct 2017, at 13.32, Javier González <jg@lightnvm.io> wrote:
> 
>> On 1 Oct 2017, at 15.23, Rakesh Pandit <rakesh@tuxera.com> wrote:
>> 
>> We already pass the structure pointer so no need to pass the member.
>> 
>> Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
>> ---
>> drivers/lightnvm/pblk-rb.c | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>> 
>> diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c
>> index 05e6b2e..920ffac 100644
>> --- a/drivers/lightnvm/pblk-rb.c
>> +++ b/drivers/lightnvm/pblk-rb.c
>> @@ -201,9 +201,9 @@ unsigned int pblk_rb_read_commit(struct pblk_rb *rb, unsigned int nr_entries)
>> 	return subm;
>> }
>> 
>> -static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int *l2p_upd,
>> -				unsigned int to_update)
>> +static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int to_update)
>> {
>> +	unsigned int l2p_update = rb->l2p_update;
>> 	struct pblk *pblk = container_of(rb, struct pblk, rwb);
>> 	struct pblk_line *line;
>> 	struct pblk_rb_entry *entry;
>> @@ -213,7 +213,7 @@ static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int *l2p_upd,
>> 	int flags;
>> 
>> 	for (i = 0; i < to_update; i++) {
>> -		entry = &rb->entries[*l2p_upd];
>> +		entry = &rb->entries[l2p_update];
>> 		w_ctx = &entry->w_ctx;
>> 
>> 		flags = READ_ONCE(entry->w_ctx.flags);
>> @@ -230,7 +230,7 @@ static int __pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int *l2p_upd,
>> 		line = &pblk->lines[pblk_tgt_ppa_to_line(w_ctx->ppa)];
>> 		kref_put(&line->ref, pblk_line_put);
>> 		clean_wctx(w_ctx);
>> -		*l2p_upd = (*l2p_upd + 1) & (rb->nr_entries - 1);
>> +		rb->l2p_update = (l2p_update + 1) & (rb->nr_entries - 1);

This is wrong. It should be rb->l2p_update when doing +1, otherwise you
are not using the updated l2p_update value. The result is the pipeline
stalling as the l2p pointer is left behind.

I'll fix it when picking it up.

Please test the patches before submitting.

Javier.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/6] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p Rakesh Pandit <rakesh@tuxera.com> - 2017-10-01 15:30 +0200
  Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in  __pblk_rb_update_l2p Javier González <jg@lightnvm.io> - 2017-10-02 13:40 +0200
    Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in  __pblk_rb_update_l2p Javier González <jg@lightnvm.io> - 2017-10-02 22:50 +0200
      Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in  __pblk_rb_update_l2p Rakesh Pandit <rakesh@tuxera.com> - 2017-10-02 22:50 +0200

csiph-web