From: Andre Noll <maan@systemlinux.org>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Neil Brown <neilb@suse.de>, linux-raid@vger.kernel.org
Subject: Re: [PATCH v2 08/11] async_tx: add support for asynchronous GF multiplication
Date: Fri, 22 May 2009 10:29:01 +0200 [thread overview]
Message-ID: <20090522082901.GM11504@skl-net.de> (raw)
In-Reply-To: <20090519010006.4104.70181.stgit@dwillia2-linux.ch.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]
On Mon, May 18, 2009 at 06:00:07PM -0700, Dan Williams wrote:
> +/* the struct page *blocks[] parameter passed to async_gen_syndrome()
> + * and async_syndrome_val() contains the 'P' destination address at
> + * blocks[disks-2] and the 'Q' destination address at blocks[disks-1]
> + *
> + * note: these are macros as they are used a lvalues
> + */
> +#define P(b, d) (b[d-2])
> +#define Q(b, d) (b[d-1])
s/a lvalues/as lvalues
> + /* convert source addresses being careful to collapse 'empty'
> + * sources and update the coefficients accordingly
> + */
> + for (i = 0, idx = 0; i < src_cnt; i++) {
> + if (is_raid6_zero_block(blocks[i]))
> + continue;
> + dma_src[idx] = dma_map_page(dma->dev, blocks[i], offset, len,
> + DMA_TO_DEVICE);
> + coefs[idx] = scfs[i];
> + idx++;
> + }
> + src_cnt = idx;
If P is disabled, we could further collapse this loop by also skipping
sources where the coefficient is zero. Not sure if this would be a win
though.
> +
> + while (src_cnt > 0) {
> + submit->flags = flags_orig;
> + pq_src_cnt = min(src_cnt, dma_maxpq(dma, dma_flags));
> + /* if we are submitting additional pqs, leave the chain open,
> + * clear the callback parameters, and leave the destination
> + * buffers mapped
> + */
> + if (src_cnt > pq_src_cnt) {
> + submit->flags &= ~ASYNC_TX_ACK;
> + dma_flags |= DMA_COMPL_SKIP_DEST_UNMAP;
> + submit->cb_fn = NULL;
> + submit->cb_param = NULL;
> + } else {
> + dma_flags &= ~DMA_COMPL_SKIP_DEST_UNMAP;
> + submit->cb_fn = cb_fn_orig;
> + submit->cb_param = cb_param_orig;
> + }
> + if (submit->cb_fn)
> + dma_flags |= DMA_PREP_INTERRUPT;
The last if() can go to the else branch.
> +/**
> + * do_sync_gen_syndrome - synchronously calculate a raid6 syndrome
> + */
> +static void
> +do_sync_gen_syndrome(struct page **blocks, unsigned int offset, int disks,
> + size_t len, struct async_submit_ctl *submit)
> +{
> + void **srcs;
> + int i;
> +
> + if (submit->scribble)
> + srcs = (void **) submit->scribble;
Unnecessary cast.
> + else
> + srcs = (void **) blocks;
> +
> + for (i = 0; i < disks; i++) {
> + if (is_raid6_zero_block(blocks[i])) {
> + BUG_ON(i > disks - 3); /* P or Q can't be zero */
> + srcs[i] = (void *) blocks[i];
Another Unnecessary cast.
Otherwise, this patch looks also very nice.
Thanks
Andre
--
The only person who always got his work done by Friday was Robinson Crusoe
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2009-05-22 8:29 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 0:59 [PATCH v2 00/11] Asynchronous raid6 acceleration (part 1 of 3) Dan Williams
2009-05-19 0:59 ` [PATCH v2 01/11] async_tx: rename zero_sum to val Dan Williams
[not found] ` <f12847240905200110x63b22601idbbdf3369984fa9a@mail.gmail.com>
2009-05-29 13:41 ` Sosnowski, Maciej
2009-06-03 18:12 ` Dan Williams
2009-05-19 0:59 ` [PATCH v2 02/11] async_tx: kill ASYNC_TX_DEP_ACK flag Dan Williams
[not found] ` <f12847240905250320w74897dabo6576b4b48bd19c0c@mail.gmail.com>
2009-05-29 13:41 ` Sosnowski, Maciej
2009-06-03 18:42 ` Dan Williams
2009-05-19 0:59 ` [PATCH v2 03/11] async_tx: structify submission arguments, add scribble Dan Williams
2009-05-20 8:06 ` Andre Noll
2009-05-20 18:19 ` Dan Williams
[not found] ` <f12847240905250321v774c4e8dscd7a466cd2e61168@mail.gmail.com>
2009-05-29 13:41 ` Sosnowski, Maciej
2009-06-03 19:05 ` Dan Williams
2009-05-19 0:59 ` [PATCH v2 04/11] async_xor: permit callers to pass in a 'dma/page scribble' region Dan Williams
2009-05-20 8:08 ` Andre Noll
2009-05-20 18:35 ` Dan Williams
2009-05-20 19:09 ` Andre Noll
2009-05-22 8:29 ` Andre Noll
2009-05-22 17:25 ` Dan Williams
2009-05-25 7:55 ` Andre Noll
[not found] ` <f12847240905250320w523fc657w3bca47f23442f46e@mail.gmail.com>
2009-05-29 13:41 ` Sosnowski, Maciej
2009-05-19 0:59 ` [PATCH v2 05/11] md/raid5: add scribble region for buffer lists Dan Williams
2009-05-20 8:09 ` Andre Noll
2009-05-20 19:05 ` Dan Williams
2009-06-04 6:11 ` Neil Brown
2009-06-05 19:19 ` Dan Williams
2009-06-08 17:25 ` Jody McIntyre
2009-05-19 0:59 ` [PATCH v2 06/11] async_tx: add sum check flags Dan Williams
[not found] ` <f12847240905200111p54382735v6941b52825cf4d7e@mail.gmail.com>
2009-05-29 13:41 ` Sosnowski, Maciej
2009-05-19 1:00 ` [PATCH v2 07/11] async_tx: kill needless module_{init|exit} Dan Williams
[not found] ` <f12847240905250323o21113fb9xbc4c16eea07b215@mail.gmail.com>
2009-05-29 13:42 ` Sosnowski, Maciej
2009-05-19 1:00 ` [PATCH v2 08/11] async_tx: add support for asynchronous GF multiplication Dan Williams
2009-05-22 8:29 ` Andre Noll [this message]
2009-06-03 22:11 ` Dan Williams
[not found] ` <f12847240905200111q37457b29lb9e30879e251888@mail.gmail.com>
2009-05-29 13:42 ` Sosnowski, Maciej
2009-06-03 22:16 ` Dan Williams
2009-05-19 1:00 ` [PATCH v2 09/11] async_tx: add support for asynchronous RAID6 recovery operations Dan Williams
2009-05-22 8:29 ` Andre Noll
2009-05-22 18:39 ` Dan Williams
[not found] ` <f12847240905250323q2e14efd6q69022a62cc7fd01f@mail.gmail.com>
2009-05-29 13:42 ` Sosnowski, Maciej
2009-05-19 1:00 ` [PATCH v2 10/11] dmatest: add pq support Dan Williams
[not found] ` <f12847240905250324t1a55b757hc8cd06d6b9663efe@mail.gmail.com>
2009-05-29 13:42 ` Sosnowski, Maciej
2009-05-19 1:00 ` [PATCH v2 11/11] async_tx: raid6 recovery self test Dan Williams
2009-05-22 8:29 ` Andre Noll
2009-06-03 21:42 ` Dan Williams
[not found] ` <f12847240905250324k2b4a0c7as9ac9b084d3707ce5@mail.gmail.com>
2009-05-29 13:42 ` Sosnowski, Maciej
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=20090522082901.GM11504@skl-net.de \
--to=maan@systemlinux.org \
--cc=dan.j.williams@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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).