* [PATCH] dmatest: add ability to disable pq and xor
@ 2013-05-17 17:54 Jon Mason
2013-05-31 8:22 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Jon Mason @ 2013-05-17 17:54 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-kernel, Dave Jiang, Vinod Koul
dmatest would create a thread to stress XOR and PQ, if the capability is
present in the hardware. Add the ability to disable XOR and PQ by
disabling it if *_sources are set to zero.
Signed-off-by: Jon Mason <jon.mason@intel.com>
---
drivers/dma/dmatest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index d8ce4ec..7de610d 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -904,11 +904,11 @@ static int dmatest_add_channel(struct dmatest_info *info,
cnt = dmatest_add_threads(info, dtc, DMA_MEMCPY);
thread_count += cnt > 0 ? cnt : 0;
}
- if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
+ if (dma_has_cap(DMA_XOR, dma_dev->cap_mask) && xor_sources) {
cnt = dmatest_add_threads(info, dtc, DMA_XOR);
thread_count += cnt > 0 ? cnt : 0;
}
- if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
+ if (dma_has_cap(DMA_PQ, dma_dev->cap_mask) && pq_sources) {
cnt = dmatest_add_threads(info, dtc, DMA_PQ);
thread_count += cnt > 0 ? cnt : 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] dmatest: add ability to disable pq and xor
2013-05-17 17:54 [PATCH] dmatest: add ability to disable pq and xor Jon Mason
@ 2013-05-31 8:22 ` Andy Shevchenko
2013-06-03 23:29 ` Jon Mason
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2013-05-31 8:22 UTC (permalink / raw)
To: Jon Mason
Cc: Dan Williams, linux-kernel@vger.kernel.org, Dave Jiang,
Vinod Koul
On Fri, May 17, 2013 at 8:54 PM, Jon Mason <jon.mason@intel.com> wrote:
> dmatest would create a thread to stress XOR and PQ, if the capability is
> present in the hardware. Add the ability to disable XOR and PQ by
> disabling it if *_sources are set to zero.
Sorry, didn't comment this earlier.
Those threads are independent including MEMCPY stuff.
I think it's better to have one additional parameter let's say
type_of_test where you can set
1 for MEMCPY
2 for XOR
4 for PQ
Share this parameter via debugfs and use 0x07 as default value.
I doubt we need this as a module parameter.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dmatest: add ability to disable pq and xor
2013-05-31 8:22 ` Andy Shevchenko
@ 2013-06-03 23:29 ` Jon Mason
2013-06-04 7:25 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Jon Mason @ 2013-06-03 23:29 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Dan Williams, linux-kernel@vger.kernel.org, Dave Jiang,
Vinod Koul
On Fri, May 31, 2013 at 11:22:10AM +0300, Andy Shevchenko wrote:
> On Fri, May 17, 2013 at 8:54 PM, Jon Mason <jon.mason@intel.com> wrote:
> > dmatest would create a thread to stress XOR and PQ, if the capability is
> > present in the hardware. Add the ability to disable XOR and PQ by
> > disabling it if *_sources are set to zero.
>
> Sorry, didn't comment this earlier.
>
> Those threads are independent including MEMCPY stuff.
> I think it's better to have one additional parameter let's say
> type_of_test where you can set
> 1 for MEMCPY
> 2 for XOR
> 4 for PQ
>
> Share this parameter via debugfs and use 0x07 as default value.
> I doubt we need this as a module parameter.
This is using the existing module parameter, so there is nothing new
added. Since the testing is started immediately upon module
insertion, there needs to be a way to prevent it from ever starting.
Thanks,
Jon
>
> --
> With Best Regards,
> Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dmatest: add ability to disable pq and xor
2013-06-03 23:29 ` Jon Mason
@ 2013-06-04 7:25 ` Andy Shevchenko
2013-06-04 17:11 ` Dan Williams
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2013-06-04 7:25 UTC (permalink / raw)
To: Jon Mason
Cc: Dan Williams, linux-kernel@vger.kernel.org, Dave Jiang,
Vinod Koul
On Tue, Jun 4, 2013 at 2:29 AM, Jon Mason <jon.mason@intel.com> wrote:
> On Fri, May 31, 2013 at 11:22:10AM +0300, Andy Shevchenko wrote:
>> On Fri, May 17, 2013 at 8:54 PM, Jon Mason <jon.mason@intel.com> wrote:
>> > dmatest would create a thread to stress XOR and PQ, if the capability is
>> > present in the hardware. Add the ability to disable XOR and PQ by
>> > disabling it if *_sources are set to zero.
>>
>> Sorry, didn't comment this earlier.
>>
>> Those threads are independent including MEMCPY stuff.
>> I think it's better to have one additional parameter let's say
>> type_of_test where you can set
>> 1 for MEMCPY
>> 2 for XOR
>> 4 for PQ
>>
>> Share this parameter via debugfs and use 0x07 as default value.
>> I doubt we need this as a module parameter.
>
> This is using the existing module parameter, so there is nothing new
> added.
That's why it's a bit confusing. User can more easily forget the
'magic' numbers. And I see no reason to prevent user to enter 0 as a
number of sources.
Moreover, your patch doesn't cover the case when user doesn't want to
run MEMCPY thread.
> Since the testing is started immediately upon module
> insertion,
It used to be so, but nowadays it's true only when dmatest is compiled in.
If someone wants to compile in that module they probably want to run
stress tests, where XOR and PQ might be useful.
> there needs to be a way to prevent it from ever starting.
My opinion I already shared, new node under debugfs. There is might be
a good reason to add a new module parameter as well.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dmatest: add ability to disable pq and xor
2013-06-04 7:25 ` Andy Shevchenko
@ 2013-06-04 17:11 ` Dan Williams
2013-06-09 19:21 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2013-06-04 17:11 UTC (permalink / raw)
To: Andy Shevchenko, Jon Mason
Cc: linux-kernel@vger.kernel.org, Dave Jiang, Vinod Koul
On 6/4/13 12:25 AM, "Andy Shevchenko" <andy.shevchenko@gmail.com> wrote:
>On Tue, Jun 4, 2013 at 2:29 AM, Jon Mason <jon.mason@intel.com> wrote:
>> On Fri, May 31, 2013 at 11:22:10AM +0300, Andy Shevchenko wrote:
>>> On Fri, May 17, 2013 at 8:54 PM, Jon Mason <jon.mason@intel.com> wrote:
>>> > dmatest would create a thread to stress XOR and PQ, if the
>>>capability is
>>> > present in the hardware. Add the ability to disable XOR and PQ by
>>> > disabling it if *_sources are set to zero.
>>>
>>> Sorry, didn't comment this earlier.
>>>
>>> Those threads are independent including MEMCPY stuff.
>>> I think it's better to have one additional parameter let's say
>>> type_of_test where you can set
>>> 1 for MEMCPY
>>> 2 for XOR
>>> 4 for PQ
>>>
>>> Share this parameter via debugfs and use 0x07 as default value.
>>> I doubt we need this as a module parameter.
>>
>> This is using the existing module parameter, so there is nothing new
>> added.
>
>That's why it's a bit confusing. User can more easily forget the
>'magic' numbers. And I see no reason to prevent user to enter 0 as a
>number of sources.
Well, source counts less than 2 are invalid for these operations, but that
is besides the point.
>Moreover, your patch doesn't cover the case when user doesn't want to
>run MEMCPY thread.
Yes, this is what I wanted to point out. If we're adding per operation
type selection, might as well enable memcpy to be controlled too.
Especially if we just use a bitmap_and() with the dma_cap_mask() to pick
which tests to run. Might also encourage some slave-op test types to be
added as well.
>
>> Since the testing is started immediately upon module
>> insertion,
>
>It used to be so, but nowadays it's true only when dmatest is compiled in.
>If someone wants to compile in that module they probably want to run
>stress tests, where XOR and PQ might be useful.
...and they would want the test selection to be specified on the kernel
command line. At least that's how I used compiled in dmatest in the past.
>
>> there needs to be a way to prevent it from ever starting.
>
>My opinion I already shared, new node under debugfs. There is might be
>a good reason to add a new module parameter as well.
I'm not seeing why debugfs is helpful here. Just make it a module
parameter that calls a routine to setup the bit mask.
--
Dan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dmatest: add ability to disable pq and xor
2013-06-04 17:11 ` Dan Williams
@ 2013-06-09 19:21 ` Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2013-06-09 19:21 UTC (permalink / raw)
To: Dan Williams
Cc: Jon Mason, linux-kernel@vger.kernel.org, Dave Jiang, Vinod Koul
On Tue, Jun 4, 2013 at 8:11 PM, Dan Williams <djbw@fb.com> wrote:
> On 6/4/13 12:25 AM, "Andy Shevchenko" <andy.shevchenko@gmail.com> wrote:
>>On Tue, Jun 4, 2013 at 2:29 AM, Jon Mason <jon.mason@intel.com> wrote:
>>> On Fri, May 31, 2013 at 11:22:10AM +0300, Andy Shevchenko wrote:
[]
>>> Since the testing is started immediately upon module
>>> insertion,
>>It used to be so, but nowadays it's true only when dmatest is compiled in.
>>If someone wants to compile in that module they probably want to run
>>stress tests, where XOR and PQ might be useful.
>
> ...and they would want the test selection to be specified on the kernel
> command line. At least that's how I used compiled in dmatest in the past.
Actually you're right. Better to have it in that case too.
>>My opinion I already shared, new node under debugfs. There is might be
>>a good reason to add a new module parameter as well.
>
> I'm not seeing why debugfs is helpful here. Just make it a module
> parameter that calls a routine to setup the bit mask.
I'm not objecting against module parameter, though I would like to see
debugfs node for that as well.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-09 19:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17 17:54 [PATCH] dmatest: add ability to disable pq and xor Jon Mason
2013-05-31 8:22 ` Andy Shevchenko
2013-06-03 23:29 ` Jon Mason
2013-06-04 7:25 ` Andy Shevchenko
2013-06-04 17:11 ` Dan Williams
2013-06-09 19:21 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox