Re: [PATCH V2 5/5] dmaengine: Documentation: Add documentation for multi chan testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 31/08/18 15:02, Peter Ujfalusi wrote:
> Hi Seraj,
> 
> On 2018-08-31 16:41, Seraj Mohammed wrote:
>> Hello,
>>
>> On 31/08/18 12:17, Peter Ujfalusi wrote:
>>> Hi,
>>>
>>> On 2018-08-31 14:03, Seraj Alijan wrote:
>>>> Modify documentation to add multi channel testing support.
>>>>
>>>> Signed-off-by: Seraj Alijan <seraj.alijan@xxxxxxxxxxx>
>>>> ---
>>>>  Documentation/driver-api/dmaengine/dmatest.rst | 27 ++++++++++++++++++++------
>>>>  1 file changed, 21 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/Documentation/driver-api/dmaengine/dmatest.rst b/Documentation/driver-api/dmaengine/dmatest.rst
>>>> index 7ce5e71..0a7e4c3 100644
>>>> --- a/Documentation/driver-api/dmaengine/dmatest.rst
>>>> +++ b/Documentation/driver-api/dmaengine/dmatest.rst
>>>> @@ -26,28 +26,43 @@ Part 2 - When dmatest is built as a module
>>>>  
>>>>  Example of usage::
>>>>  
>>>> -    % modprobe dmatest channel=dma0chan0 timeout=2000 iterations=1 run=1
>>>> +    % modprobe dmatest timeout=2000 iterations=1 channel=dma0chan0 run=1
>>>>  
>>>>  ...or::
>>>>  
>>>>      % modprobe dmatest
>>>> -    % echo dma0chan0 > /sys/module/dmatest/parameters/channel
>>>>      % echo 2000 > /sys/module/dmatest/parameters/timeout
>>>>      % echo 1 > /sys/module/dmatest/parameters/iterations
>>>> +    % echo dma0chan0 > /sys/module/dmatest/parameters/channel
>>>>      % echo 1 > /sys/module/dmatest/parameters/run
>>>>  
>>>>  ...or on the kernel command line::
>>>>  
>>>> -    dmatest.channel=dma0chan0 dmatest.timeout=2000 dmatest.iterations=1 dmatest.run=1
>>>> +    dmatest.timeout=2000 dmatest.iterations=1 dmatest.channel=dma0chan0 dmatest.run=1
>>>> +
>>>> +Example of multi-channel test usage:
>>>> +    % modprobe dmatest
>>>> +    % echo 2000 > /sys/module/dmatest/parameters/timeout
>>>> +    % echo 1 > /sys/module/dmatest/parameters/iterations
>>>> +    % echo dma0chan0 > /sys/module/dmatest/parameters/channel
>>>> +    % echo dma0chan1 > /sys/module/dmatest/parameters/channel
>>>> +    % echo dma0chan2 > /sys/module/dmatest/parameters/channel
>>>
>>> Can I still use:
>>> echo "" > /sys/module/dmatest/parameters/channel
>>>
>>> to stop dmatest to run on the specific channel(s) or do I need to reboot
>>> the machine to do so?
>>
>> is this behavior documented somewhere? or did you discover this from your
>> experience with using the module?
>> The short answer to your question is no, with this change you cannot stop
>> a test by echoing an empty string to the channel parameter, you will either
>> have to run the test, or reboot the machine.
>>
>> Setting the channel parameter to an empty string will request all
>> channels up to "max_channels" parameter value. This is because with this
>> change, editing the channel parameter will invoke the process of allocating
>> a thread for the specified channel and storing that thread in a thread
>> list, after that, setting run to 1 will simply iterate through the thread
>> list and start all pending threads.
>>
>>> I normally test multi channel memcpy with:
>>> echo 8000000 > /sys/module/dmatest/parameters/test_buf_size
>>> echo 2000 > /sys/module/dmatest/parameters/timeout
>>> echo 20 > /sys/module/dmatest/parameters/iterations
>>> echo 20 > /sys/module/dmatest/parameters/max_channels
>>> echo 1 > /sys/module/dmatest/parameters/run
>>>
>>> So it will start running memtest on 20 channels.
>>>
>>> If I do a test on specific channel (different DMA controller) I set the
>>> channel run the test and then with "" I can revert back to normal
>>> torture test.
>>
>> Yes, but the problem is that you either run a test on all channels, or
>> a single channel. This change makes it possible to specify a list of
>> channels to test, for example we can now launch a test on channels 0,3,5,6
>> by doing
>>
>> echo dma0chan0 > /sys/module/dmatest/parameters/channel
>> echo dma0chan3 > /sys/module/dmatest/parameters/channel
>> echo dma0chan5 > /sys/module/dmatest/parameters/channel
>> echo dma0chan6 > /sys/module/dmatest/parameters/channel
>> echo 1 > /sys/module/dmatest/parameters/run
>>
>> as far as I'm aware this functionality was not possible before.
> 
> True and it is something which would be nice to have. I could construct
> single test run for channels on different DMA controller. That is pretty
> cool.
> 
> However, if I got it right I need to reboot the machine if I want to
> change any of the parameters for a re-run.
> Let's say I want to run tests on 6 channel with 50K buffers, 100K 1M, 10M.
> I can not do this without rebooting, right?

You only need to reboot the machine if you want to change paameters after
allocating the channels.

Example:

echo 4096 > /sys/module/dmatest/parameters/test_buf_size
echo 1 > /sys/module/dmatest/parameters/iterations
echo 6 > /sys/module/dmatest/parameters/alignment
echo 0 > /sys/module/dmatest/parameters/noverify
echo 0 > /sys/module/dmatest/parameters/norandom
echo 1 > /sys/module/dmatest/parameters/threads_per_chan
echo 20000 > /sys/module/dmatest/parameters/timeout

At the is point, you can still change any of the parameters above without
rebooting

echo dma0chan0 > /sys/module/dmatest/parameters/channel
[   31.465240] dmatest: Added 1 threads using dma0chan0
echo dma0chan1 > /sys/module/dmatest/parameters/channel
[   33.142020] dmatest: Added 1 threads using dma0chan1
echo dma0chan2 > /sys/module/dmatest/parameters/channel
[   34.402123] dmatest: Added 1 threads using dma0chan2

As you can see now channels 0,1, 2 have already been allocated and their
respective threads are pending. At this point if you want to change
any parameters you have to reboot, because the channels have already been
requested with the properties set above.

echo 1 > /sys/module/dmatest/parameters/run
dmatest: dma0chan0-copy0: summary 1 tests, 0 failures 285.71 iops 571
KB/s (0)
dmatest: dma0chan2-copy0: summary 1 tests, 0 failures 142.85 iops 285
KB/s (0)
dmatest: dma0chan1-copy0: summary 1 tests, 0 failures 142.85 iops 428
KB/s (0)

At this point the test is finished and you can run a new test with
completely different parameters without having to reboot.

> Would not be possible to:
> 
> echo "dma0chan0 dma0chan3 dma0chan5 dma0chan6" >
> /sys/module/dmatest/parameters/channel
> 
> and use the same logic already existing for max_channels to start off
> the tests on different channels?

It is possible, but i wouldn't make it possible to start all threads at
once, which is what i want to do. If i do it this way, the test would have
have extract the channels one by one and allocate and start them
sequentially. My patch ensures that when I set run to 1, all channels fire
off at the same time, or as close as possible without having the overhead
of allocating channels inbetween transfers.

>> You can still run your torture test with a simple modification:
>>
>> echo 8000000 > /sys/module/dmatest/parameters/test_buf_size
>> echo 2000 > /sys/module/dmatest/parameters/timeout
>> echo 20 > /sys/module/dmatest/parameters/iterations
>> echo 20 > /sys/module/dmatest/parameters/max_channels
>> echo "" > /sys/module/dmatest/parameters/channel << allocates 20 channels
>> echo 1 > /sys/module/dmatest/parameters/run
> 
> Sure, but if I test something on a specific channels I need to reboot.
> Or if I want to change parameters for a next run...
> 
>>
>>>> +    % echo 1 > /sys/module/dmatest/parameters/run
>>>>  
>>>> +Note: the channel parameter should always be the last parameter set prior to
>>>> +running the test (setting run=1), this is because upon setting the channel
>>>> +parameter, that specific channel is requested using the dmaengine and a thread
>>>> +is created with the existing parameters. This thread is set as pending
>>>> +and will be executed once run is set to 1. Any parameters set after the thread
>>>> +is created are not applied.
>>>>  .. hint::
>>>>    available channel list could be extracted by running the following command::
>>>>  
>>>>      % ls -1 /sys/class/dma/
>>>>  
>>>> -Once started a message like "dmatest: Started 1 threads using dma0chan0" is
>>>> -emitted. After that only test failure messages are reported until the test
>>>> -stops.
>>>> +Once started a message like " dmatest: Added 1 threads using dma0chan0" is
>>>> +emitted. A thread for that specific channel is created and is now pending, the
>>>> +pending thread is started once run is to 1.
>>>>  
>>>>  Note that running a new test will not stop any in progress test.
>>>>  
>>>>
>>>
>>> - Péter
>>>
>>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>>>
>>
>> - Seraj
>>
> 
> - Péter
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux