From: Andrew Morton <akpm@osdl.org>
To: Chris Leech <christopher.leech@intel.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/9] [I/OAT] DMA memcpy subsystem
Date: Tue, 23 May 2006 17:51:08 -0700 [thread overview]
Message-ID: <20060523175108.42aee1ff.akpm@osdl.org> (raw)
In-Reply-To: <20060524002012.19403.50151.stgit@gitlost.site>
Chris Leech <christopher.leech@intel.com> wrote:
>
> +/**
> + * dma_client_chan_free - release a DMA channel
> + * @chan: &dma_chan
> + */
> +void dma_chan_cleanup(struct kref *kref)
> +{
> + struct dma_chan *chan = container_of(kref, struct dma_chan, refcount);
> + chan->device->device_free_chan_resources(chan);
> + chan->client = NULL;
> + kref_put(&chan->device->refcount, dma_async_device_cleanup);
> +}
> +
> +static void dma_chan_free_rcu(struct rcu_head *rcu)
> +{
> + struct dma_chan *chan = container_of(rcu, struct dma_chan, rcu);
> + int bias = 0x7FFFFFFF;
> + int i;
> + for_each_cpu(i)
> + bias -= local_read(&per_cpu_ptr(chan->local, i)->refcount);
> + atomic_sub(bias, &chan->refcount.refcount);
> + kref_put(&chan->refcount, dma_chan_cleanup);
> +}
> +
> +static void dma_client_chan_free(struct dma_chan *chan)
> +{
> + atomic_add(0x7FFFFFFF, &chan->refcount.refcount);
> + chan->slow_ref = 1;
> + call_rcu(&chan->rcu, dma_chan_free_rcu);
> +}
A comment describing this `bias' magic would be nice.
next prev parent reply other threads:[~2006-05-24 0:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 0:16 [PATCH 0/9] I/OAT repost Chris Leech
2006-05-24 0:20 ` [PATCH 1/9] [I/OAT] DMA memcpy subsystem Chris Leech
2006-05-24 0:48 ` Andrew Morton
2006-05-24 6:31 ` Nathan Lynch
2006-05-24 0:51 ` Andrew Morton [this message]
2006-05-25 17:59 ` Olof Johansson
2006-05-25 18:09 ` Olof Johansson
2006-05-24 0:20 ` [PATCH 2/9] [I/OAT] Driver for the Intel(R) I/OAT DMA engine Chris Leech
2006-05-24 0:56 ` Andrew Morton
2006-05-25 18:00 ` Olof Johansson
2006-05-30 23:27 ` Adrian Bunk
2006-05-24 0:20 ` [PATCH 3/9] [I/OAT] Setup the networking subsystem as a DMA client Chris Leech
2006-05-24 1:13 ` David Miller
2006-05-24 0:20 ` [PATCH 4/9] [I/OAT] Utility functions for offloading sk_buff to iovec copies Chris Leech
2006-05-24 0:20 ` [PATCH 5/9] [I/OAT] Structure changes for TCP recv offload to I/OAT Chris Leech
2006-05-24 0:20 ` [PATCH 6/9] [I/OAT] Rename cleanup_rbuf to tcp_cleanup_rbuf and make non-static Chris Leech
2006-05-24 0:20 ` [PATCH 7/9] [I/OAT] make sk_eat_skb I/OAT aware Chris Leech
2006-05-24 0:20 ` [PATCH 8/9] [I/OAT] Add a sysctl for tuning the I/OAT offloaded I/O threshold Chris Leech
2006-05-24 1:02 ` Andrew Morton
2006-05-24 0:20 ` [PATCH 9/9] [I/OAT] TCP recv offload to I/OAT Chris Leech
2006-05-24 0:22 ` [PATCH 0/9] I/OAT repost David Miller
-- strict thread matches above, loose matches on Subject: below --
2006-05-08 22:16 [PATCH 0/9] I/OAT network recv copy offload Chris Leech
2006-05-08 22:17 ` [PATCH 1/9] [I/OAT] DMA memcpy subsystem Chris Leech
2006-03-29 22:55 [PATCH 0/9] I/OAT Chris Leech
2006-03-29 22:55 ` [PATCH 1/9] [I/OAT] DMA memcpy subsystem Chris Leech
2006-03-30 8:01 ` Kumar Gala
2006-03-30 18:36 ` Andrew Grover
2006-03-30 19:57 ` Kumar Gala
2006-03-31 8:26 ` Ingo Oeser
2006-03-31 20:04 ` Andrew Grover
2006-03-31 20:06 ` Kumar Gala
2006-03-31 20:27 ` Andrew Grover
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=20060523175108.42aee1ff.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=christopher.leech@intel.com \
--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 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).