Hi, On 09/03/2018 05:49 PM, Seraj Mohammed wrote: > Hi, > > On 03/09/18 09:19, Peter Ujfalusi wrote: >> Hi, >> >> On 2018-08-31 18:01, Seraj Mohammed wrote: >>>> 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. >> >> Instead of reboot running the test is fine to clear things up. >> >>> 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 >> >> But I can not do: >> 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 >> >> it will _not_ start 20 iteration tests on 20 channels. > > This is correct behavior, because issuing > echo 1 > /sys/module/dmatest/parameters/run > will no longer handle channel allocation with this patch, all > functionality dealing with allocating channels has been stripped off > from the run callback and put into a new callback that is triggered by > the channel parameter. > > So under the new change, you can do the same by: > 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 << Will trigger call > back to allocate up to max_channels if invoked with empty string > echo 1 > /sys/module/dmatest/parameters/run Yep, I figured that out after trying this and that... >> I need to: >> echo dma0chan10 > /sys/module/dmatest/parameters/channel >> cat /sys/module/dmatest/parameters/channel >> dma0chan10 >> >> echo dma0chan11 > /sys/module/dmatest/parameters/channel >> cat /sys/module/dmatest/parameters/channel >> dma0chan11 >> >> ^ it tells me that only dma0chan11 is in channels while in fact I have >> dma0chan10 and dma0chan11 selected. > > Correct, reading the channel parameter will report back the name of the > LAST channel that was allocated, not a string containing all channels. I think this is a bit awkward. What I would expect that it will give me the list of channels I have already scheduled for the test. They can be in the allocated state with different parameters, but that is minor thing. >> then I run the test: >> echo 1 > /sys/module/dmatest/parameters/run >> [ 514.370959] dmatest: dma0chan10-copy: summary 1 tests, 0 failures >> 7692 iops 15384 KB/s (0) >> [ 514.371099] dmatest: dma0chan11-copy: summary 1 tests, 0 failures >> 11111 iops 22222 KB/s (0) >> >> After this: >> cat /sys/module/dmatest/parameters/channel returns nothing, which I >> believe is correct. So I could be able to run the 20 iteration on 20 >> channels, but I can not: >> echo 20 > /sys/module/dmatest/parameters/iterations >> echo 20 > /sys/module/dmatest/parameters/max_channels >> echo 1 > /sys/module/dmatest/parameters/run >> >> The patch effectively breaks the batch mode via max_channels. > > It doesn't matter if the channel string is empty, you need to invoke the > channel parameter to allocate channels prior to running the test. > > This should work > > echo 20 > /sys/module/dmatest/parameters/iterations > echo 20 > /sys/module/dmatest/parameters/max_channels > echo "" > /sys/module/dmatest/parameters/channel > echo 1 > /sys/module/dmatest/parameters/run Yes, this works. >>> 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. >> >> That's fine. >> >> If I want to just repeat the same test then I would put the same >> channels back in a loop and run it again to run them overnight for example. >> >> But it is still unclear how the channels will be released.. >> cat /sys/class/dma/dma0chan10/in_use >> 0 >> echo dma0chan10 > /sys/module/dmatest/parameters/channel >> cat /sys/class/dma/dma0chan10/in_use >> 1 >> echo 1 > /sys/module/dmatest/parameters/run >> [ 690.326039] dmatest: dma0chan10-copy: summary 20 tests, 0 failures 71 >> iops 290511 KB/s (0) >> cat /sys/class/dma/dma0chan10/in_use >> 1 >> echo 1 > /sys/module/dmatest/parameters/run >> # will not run any tests >> cat /sys/class/dma/dma0chan10/in_use >> 1 >> >> echo dma0chan12 > /sys/module/dmatest/parameters/channel >> cat /sys/class/dma/dma0chan10/in_use >> 0 >> cat /sys/class/dma/dma0chan12/in_use >> 1 >> >> >> So it appears that the channel is going to be released when a new >> channel is added, right? > > Correct, after completing a test, adding a new channel will clear all > previously allocated channels to ensure the new test is not polluted > with residual parameters from prior test runs. > > Another way of clearing channels from previous test run is to query the > run parameter: > > cat /sys/module/dmatest/parameters/run > > should clear all channels allocated by previous test run. Since the channels from the previous run will be discarded - even if in the next run we configure the same channels, wouldn't it be nicer to release everything when the test finishes to not hog on resources? >> Which brought up some interesting thing: >> echo "" > /sys/module/dmatest/parameters/channel >> >> Will add the 20 channels to the test :o >> >> One thing would be really nice is to print something when we hit run and >> the dmatest actually going to do something or if the dmatest is not >> configured properly and will not going to run any test. > > Good idea, adding a message informing user should clear up any confusion. That would be great. The threads could print that they are starting or the trigger code tells how many threads are going to be run, or if none is configured tell that. But I think the documentation should be updated to avoid a mail thread this long to figure out what to expect and how to use the new dmatest ;) -- Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki