Re: [rfc 23/45] cpu alloc: dmaengine conversion

Christoph Lameter
2007-11-20T20:46:56Z

On Tue, 20 Nov 2007, Mathieu Desnoyers wrote:

> > @@ -488,11 +487,8 @@ dma_async_memcpy_buf_to_buf(struct dma_c
> > tx->tx_set_dest(addr, tx, 0);
> > cookie = tx->tx_submit(tx);
> >
> > - cpu = get_cpu();
> > - per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
> > - per_cpu_ptr(chan->local, cpu)->memcpy_count++;
> > - put_cpu();
> > -
> > + __CPU_ADD(chan->local->bytes_transferred, len);
> > + __CPU_INC(chan->local->memcpy_count);
>
> I am wondering about the impact of the preempt disable removal here. It
> means that there is a statistically low probability that we will be
> moved to a different CPU between the bytes_transferred and the
> memcpy_count increments. I hope nobody relies on the fact that the
> per-cpu counts should match perfectly...

True. But as far as I can tell this is just statistics and technically the
operation is not complete until this function has terminated. So one half
was run on one and one half on the other. Where the statistics should be
kept is ambiguous.

Having said that: We could leave the code unchanged if this is a concern.