Subject: Re: Measuring memory to memory copy operations (+ interrupts, DMA)
To: Lennart Augustsson <lennart@augustsson.net>
From: Paul Sommerhein <pms-netbsd@sommerhein.com>
List: tech-kern
Date: 08/14/2003 16:33:59
Lennart Augustsson <lennart@augustsson.net> writes:

> Yes, DMA can still happen while interrups are off.  On the PCI bus any
> bus mastering device can do cycles.  E.g., if you have a USB
> controller it will access memory every ms regardless of any transfers
> that have been set up.

Thanks!  So you are saying that if I disable USB support in the kernel
the controller will still do cycles? 

Regards,
Paul

>    -- Lennart
> 
> Paul Sommerhein wrote:
> 
> >I am measuring some memory to memory copy operations within the
> >kernel.  Doing this I try to minimize disturbances which affect the
> >measured cycle count.  Currently I can only see the following ways.
> >
> >   - Disabling interrupts (or raising the interrupt priority level to
> >   a high level).
> >
> >   - Flushing instruction and data caches.
> >
> >   - Serializing (finishing the instructions in the pipeline before
> >   probing).
> >
> >But, given that the interrupts are turned off, will DMA transfers
> >still be occurring?  Implying that if a device doing DMA grabs the
> >memory bus just before I start my memory to memory copying, will I
> >have to wait for the device to release the bus?
> >
> >Thanks, Paul