linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH v1 2/7] xen-blkback: use balloon pages for all mappings
Date: Mon, 15 Apr 2013 10:12:35 +0200	[thread overview]
Message-ID: <516BB673.9060308@citrix.com> (raw)
In-Reply-To: <516BB4C6.8090101@citrix.com>

>> Perhaps you could update the comment from saying 'map this grant' (which
>> implies doing it NOW as opposed to have done it already), and say:
>>
>> /*
>> .. continue using the grant non-persistently. Note that
>> we mapped it in the earlier loop and the earlier if conditional
>> sets pending_handle(pending_req, i) = map[j].handle.
>> */
>>
>>
>>
>>>                       }
>>> -                     pending_handle(pending_req, i) =
>>> -                             persistent_gnts[i]->handle;
>>> -
>>> -                     if (ret)
>>> -                             continue;
>>> -             } else {
>>> -                     pending_handle(pending_req, i) = map[j++].handle;
>>> -                     bitmap_set(pending_req->unmap_seg, i, 1);
>>> -
>>> -                     if (ret)
>>> -                             continue;
>>> +                     persistent_gnt->gnt = map[j].ref;
>>> +                     persistent_gnt->handle = map[j].handle;
>>> +                     persistent_gnt->page = pages[i];
>>
>> Oh boy, that is a confusing. i and j. Keep loosing track which one is which.
>> It lookis right.
>>
>>> +                     if (add_persistent_gnt(&blkif->persistent_gnts,
>>> +                                            persistent_gnt)) {
>>> +                             kfree(persistent_gnt);
>>
>> I would also say 'persisten_gnt = NULL' for extra measure of safety

This loop was not completely right, I failed to set the unmap_seg bit if
we tried to map the grant persistently and failed, we would just jump to
next without doing:

bitmap_set(pending_req->unmap_seg, seg_idx, 1);

  reply	other threads:[~2013-04-15  8:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27 11:10 [PATCH v1 0/7] xen-block: indirect descriptors Roger Pau Monne
2013-03-27 11:10 ` [PATCH v1 1/7] xen-blkback: print stats about persistent grants Roger Pau Monne
2013-04-09 14:47   ` Konrad Rzeszutek Wilk
2013-03-27 11:10 ` [PATCH v1 2/7] xen-blkback: use balloon pages for all mappings Roger Pau Monne
2013-04-09 14:47   ` Konrad Rzeszutek Wilk
2013-04-15  8:05     ` Roger Pau Monné
2013-04-15  8:12       ` Roger Pau Monné [this message]
2013-04-17 14:00       ` Konrad Rzeszutek Wilk
2013-04-15  9:14     ` Roger Pau Monné
2013-04-17 14:05       ` Konrad Rzeszutek Wilk
2013-04-09 15:46   ` Konrad Rzeszutek Wilk
2013-04-15  8:21     ` Roger Pau Monné
2013-03-27 11:10 ` [PATCH v1 3/7] xen-blkback: implement LRU mechanism for persistent grants Roger Pau Monne
2013-04-09 15:42   ` Konrad Rzeszutek Wilk
2013-04-15 11:19     ` Roger Pau Monné
2013-04-17 14:15       ` Konrad Rzeszutek Wilk
2013-03-27 11:10 ` [PATCH v1 4/7] xen-blkback: move pending handles list from blkbk to pending_req Roger Pau Monne
2013-03-27 11:10 ` [PATCH v1 5/7] xen-blkback: make the queue of free requests per backend Roger Pau Monne
2013-04-09 16:13   ` Konrad Rzeszutek Wilk
2013-04-15 13:50     ` Roger Pau Monné
2013-04-17 14:16       ` Konrad Rzeszutek Wilk
2013-03-27 11:10 ` [PATCH v1 6/7] xen-blkback: expand map/unmap functions Roger Pau Monne
2013-03-27 11:10 ` [PATCH v1 7/7] xen-block: implement indirect descriptors Roger Pau Monne
2013-04-09 18:49   ` Konrad Rzeszutek Wilk
2013-04-15 17:01     ` Roger Pau Monné
2013-04-17 14:25       ` Konrad Rzeszutek Wilk
2013-04-17 17:04         ` Roger Pau Monné
2013-04-17 17:27           ` Konrad Rzeszutek Wilk
2013-04-18 12:43             ` Jens Axboe
2013-04-18 14:16               ` Roger Pau Monné
2013-04-18 14:26                 ` Jens Axboe
2013-04-18 15:14                   ` Roger Pau Monné
2013-04-18 15:58                     ` Jens Axboe

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=516BB673.9060308@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xen.org \
    /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).