From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: lkml <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [4/4] DST: Algorithms used in distributed storage.
Date: Wed, 12 Dec 2007 13:20:11 +0300 [thread overview]
Message-ID: <20071212102011.GC13713@2ka.mipt.ru> (raw)
In-Reply-To: <20071212091246.GA12871@dmon-lap.sw.ru>
On Wed, Dec 12, 2007 at 12:12:47PM +0300, Dmitry Monakhov (dmonakhov@sw.ru) wrote:
> On 14:47 Mon 10 Dec , Evgeniy Polyakov wrote:
> >
> > Algorithms used in distributed storage.
> > Mirror and linear mapping code.
> Hi, i've finally take a look on your DST solution.
> It seems what your current implementation will not work on nonstandard
> devices for example software raid0.
> other comments are follows:
> > +static int dst_mirror_process_node_data(struct dst_node *n,
> > + struct dst_mirror_node_data *ndata, int op)
> > +
> > + kunmap(cmp->page);
> << MINOR_BUG:
> You has forgot to unmap page on error path, so IMHO it is better to move
> kunmap to "err_out_free_cmp" label.
Yep, I will fix this.
> > + priv = kzalloc(sizeof(struct dst_mirror_priv), GFP_KERNEL);
> > + if (!priv)
> > + return -ENOMEM;
> > +
> > + priv->chunk_num = st->disk_size;
> > +
> > + priv->chunk = vmalloc(DIV_ROUND_UP(priv->chunk_num, BITS_PER_LONG) * sizeof(long));
> << Ohhh. My. I want to add my 500G hdd. Do you really wanna
> say what i have to store 128Mb in memory object for this.
Right now yes. There was a code which used single bit for bigger
data units, but I dropped it because of resync troubles (i.e. when
one single sector has been updated, it requires to resync the whole
block). I can not say which case is better though.
> > + dprintk("%s: start: %llu, size: %llu/%u, bio: %p, req: %p, "
> > + "node: %p.\n",
> > + __func__, req->start, req->size, nr_pages, bio,
> > + req, req->node);
> > +
> > + err = n->st->queue->make_request_fn(n->st->queue, bio);
> << Why direct make_request_fn instead of generic_make_request?
generic_make_request() will queue the bio in this case,
so I call request_fn directly.
> > + for (i = 0; i < DIV_ROUND_UP(priv->chunk_num, BITS_PER_LONG); ++i) {
> > + int bit, num, start;
> > + unsigned long word = priv->chunk[i];
> > +
> > + if (!word)
> > + continue;
> > +
> > + num = 0;
> > + start = -1;
> > + while (word && num < BITS_PER_LONG) {
> > + bit = __ffs(word);
> > + if (start == -1)
> > + start = bit;
> > + num++;
> << MINOR_BUG: Seems you have misstyped here. AFAIU @num represent position
> of last non zero bit (start + num == last_non_zero_bit_pos)
> if (start == -1) {
> start = bit;
> num = 1;
> } else
> num += bit;
Yes, you are right of course.
Since I shift word to more than a single bit, @num has to be update
accordingly.
> > + word >>= (bit+1);
Dmitry, thanks a lot for comments, I will fix issues you pointed in the
next release, although will stay bitmap case opened for a while.
--
Evgeniy Polyakov
next prev parent reply other threads:[~2007-12-12 10:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <11qqqasdzxczc036@2ka.mipt.ru>
2007-12-10 11:47 ` [0/4] DST: Distributed storage Evgeniy Polyakov
2007-12-10 11:47 ` [1/4] DST: Distributed storage documentation Evgeniy Polyakov
2007-12-10 11:47 ` [2/4] DST: Core distributed storage files Evgeniy Polyakov
2007-12-10 11:47 ` [3/4] DST: Network state machine Evgeniy Polyakov
2007-12-10 11:47 ` [4/4] DST: Algorithms used in distributed storage Evgeniy Polyakov
2007-12-12 9:12 ` Dmitry Monakhov
2007-12-12 10:20 ` Evgeniy Polyakov [this message]
2007-12-13 20:43 ` [3/4] DST: Network state machine Dmitry Monakhov
2007-12-14 6:35 ` Evgeniy Polyakov
2007-12-10 12:51 ` [1/4] DST: Distributed storage documentation Kay Sievers
2007-12-10 12:58 ` Evgeniy Polyakov
2007-12-10 14:31 ` Kay Sievers
2007-12-10 14:50 ` Evgeniy Polyakov
2007-12-10 15:12 ` Evgeniy Polyakov
2007-12-10 19:02 ` Kay Sievers
2007-12-10 19:33 ` Evgeniy Polyakov
2007-12-10 19:44 ` Kay Sievers
2007-12-10 19:51 ` Evgeniy Polyakov
2007-12-10 19:56 ` Kay Sievers
2007-12-10 20:03 ` Evgeniy Polyakov
2008-01-22 19:38 [3/4] DST: Network state machine Evgeniy Polyakov
2008-01-22 19:38 ` [4/4] DST: Algorithms used in distributed storage Evgeniy Polyakov
-- strict thread matches above, loose matches on Subject: below --
2007-12-26 11:22 [3/4] DST: Network state machine Evgeniy Polyakov
2007-12-26 11:22 ` [4/4] DST: Algorithms used in distributed storage Evgeniy Polyakov
2007-12-17 15:03 [3/4] DST: Network state machine Evgeniy Polyakov
2007-12-17 15:03 ` [4/4] DST: Algorithms used in distributed storage Evgeniy Polyakov
2007-12-04 14:37 [3/4] DST: Network state machine Evgeniy Polyakov
2007-12-04 14:37 ` [4/4] DST: Algorithms used in distributed storage Evgeniy Polyakov
2007-11-29 12:53 [3/4] dst: Network state machine Evgeniy Polyakov
2007-11-29 12:53 ` [4/4] dst: Algorithms used in distributed storage Evgeniy Polyakov
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=20071212102011.GC13713@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.