* [PATCH] dma-mapping: make map_benchmark compile into module
@ 2021-03-24 2:17 Tian Tao
2021-03-24 2:30 ` Song Bao Hua (Barry Song)
2021-03-24 7:13 ` Christoph Hellwig
0 siblings, 2 replies; 5+ messages in thread
From: Tian Tao @ 2021-03-24 2:17 UTC (permalink / raw)
To: akpm, peterz, paulmck, ast, tglx, rostedt, hch, m.szyprowski,
song.bao.hua
Cc: Tian Tao, iommu, linux-kernel
under some scenarios, it is necessary to compile map_benchmark
into module to test iommu, so this patch changed Kconfig and
export_symbol to implement map_benchmark compiled into module.
On the other hand, map_benchmark is a driver, which is supposed
to be able to run as a module.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
kernel/dma/Kconfig | 2 +-
kernel/kthread.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 77b4055..0468293 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -223,7 +223,7 @@ config DMA_API_DEBUG_SG
If unsure, say N.
config DMA_MAP_BENCHMARK
- bool "Enable benchmarking of streaming DMA mapping"
+ tristate "Enable benchmarking of streaming DMA mapping"
depends on DEBUG_FS
help
Provides /sys/kernel/debug/dma_map_benchmark that helps with testing
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 1578973..fa4736f 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -455,6 +455,7 @@ void kthread_bind_mask(struct task_struct *p, const struct cpumask *mask)
{
__kthread_bind_mask(p, mask, TASK_UNINTERRUPTIBLE);
}
+EXPORT_SYMBOL(kthread_bind_mask);
/**
* kthread_bind - bind a just-created kthread to a cpu.
--
2.7.4
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH] dma-mapping: make map_benchmark compile into module
2021-03-24 2:17 [PATCH] dma-mapping: make map_benchmark compile into module Tian Tao
@ 2021-03-24 2:30 ` Song Bao Hua (Barry Song)
2021-03-24 7:13 ` Christoph Hellwig
1 sibling, 0 replies; 5+ messages in thread
From: Song Bao Hua (Barry Song) @ 2021-03-24 2:30 UTC (permalink / raw)
To: tiantao (H),
akpm, peterz, paulmck, ast, tglx, rostedt, hch, m.szyprowski
Cc: iommu, linux-kernel
> -----Original Message-----
> From: tiantao (H)
> Sent: Wednesday, March 24, 2021 3:18 PM
> To: akpm@linux-foundation.org; peterz@infradead.org; paulmck@kernel.org;
> ast@kernel.org; tglx@linutronix.de; rostedt@goodmis.org; hch@lst.de;
> m.szyprowski@samsung.com; Song Bao Hua (Barry Song)
> <song.bao.hua@hisilicon.com>
> Cc: iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org; tiantao
> (H) <tiantao6@hisilicon.com>
> Subject: [PATCH] dma-mapping: make map_benchmark compile into module
>
> under some scenarios, it is necessary to compile map_benchmark
> into module to test iommu, so this patch changed Kconfig and
> export_symbol to implement map_benchmark compiled into module.
>
> On the other hand, map_benchmark is a driver, which is supposed
> to be able to run as a module.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
Acked-by: Barry Song <song.bao.hua@hisilicon.com>
Look sensible to me. I like the idea that map_benchmark is
a driver. It seems unreasonable to always require built-in.
> kernel/dma/Kconfig | 2 +-
> kernel/kthread.c | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
> index 77b4055..0468293 100644
> --- a/kernel/dma/Kconfig
> +++ b/kernel/dma/Kconfig
> @@ -223,7 +223,7 @@ config DMA_API_DEBUG_SG
> If unsure, say N.
>
> config DMA_MAP_BENCHMARK
> - bool "Enable benchmarking of streaming DMA mapping"
> + tristate "Enable benchmarking of streaming DMA mapping"
> depends on DEBUG_FS
> help
> Provides /sys/kernel/debug/dma_map_benchmark that helps with testing
> diff --git a/kernel/kthread.c b/kernel/kthread.c
> index 1578973..fa4736f 100644
> --- a/kernel/kthread.c
> +++ b/kernel/kthread.c
> @@ -455,6 +455,7 @@ void kthread_bind_mask(struct task_struct *p, const struct
> cpumask *mask)
> {
> __kthread_bind_mask(p, mask, TASK_UNINTERRUPTIBLE);
> }
> +EXPORT_SYMBOL(kthread_bind_mask);
>
> /**
> * kthread_bind - bind a just-created kthread to a cpu.
> --
> 2.7.4
Thanks
Barry
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dma-mapping: make map_benchmark compile into module
2021-03-24 2:17 [PATCH] dma-mapping: make map_benchmark compile into module Tian Tao
2021-03-24 2:30 ` Song Bao Hua (Barry Song)
@ 2021-03-24 7:13 ` Christoph Hellwig
2021-03-24 7:33 ` Song Bao Hua (Barry Song)
1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2021-03-24 7:13 UTC (permalink / raw)
To: Tian Tao
Cc: paulmck, peterz, linux-kernel, ast, rostedt, hch, iommu, akpm, tglx
On Wed, Mar 24, 2021 at 10:17:38AM +0800, Tian Tao wrote:
> under some scenarios, it is necessary to compile map_benchmark
> into module to test iommu, so this patch changed Kconfig and
> export_symbol to implement map_benchmark compiled into module.
>
> On the other hand, map_benchmark is a driver, which is supposed
> to be able to run as a module.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Nope, we're not going to export more kthread internals for a test
module.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] dma-mapping: make map_benchmark compile into module
2021-03-24 7:13 ` Christoph Hellwig
@ 2021-03-24 7:33 ` Song Bao Hua (Barry Song)
2021-04-02 14:44 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Song Bao Hua (Barry Song) @ 2021-03-24 7:33 UTC (permalink / raw)
To: Christoph Hellwig, tiantao (H)
Cc: paulmck, peterz, ast, rostedt, linux-kernel, iommu, akpm, tglx
> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@lst.de]
> Sent: Wednesday, March 24, 2021 8:13 PM
> To: tiantao (H) <tiantao6@hisilicon.com>
> Cc: akpm@linux-foundation.org; peterz@infradead.org; paulmck@kernel.org;
> ast@kernel.org; tglx@linutronix.de; rostedt@goodmis.org; hch@lst.de;
> m.szyprowski@samsung.com; Song Bao Hua (Barry Song)
> <song.bao.hua@hisilicon.com>; iommu@lists.linux-foundation.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] dma-mapping: make map_benchmark compile into module
>
> On Wed, Mar 24, 2021 at 10:17:38AM +0800, Tian Tao wrote:
> > under some scenarios, it is necessary to compile map_benchmark
> > into module to test iommu, so this patch changed Kconfig and
> > export_symbol to implement map_benchmark compiled into module.
> >
> > On the other hand, map_benchmark is a driver, which is supposed
> > to be able to run as a module.
> >
> > Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
>
> Nope, we're not going to export more kthread internals for a test
> module.
The requirement comes from an colleague who is frequently changing
the map-bench code for some customized test purpose. and he doesn't
want to build kernel image and reboot every time. So I moved the
requirement to Tao Tian.
Right now, kthread_bind() is exported, kthread_bind_mask() seems
to be a little bit "internal" as you said, maybe a wrapper like
kthread_bind_node() won't be that "internal", comparing to exposing
the cpumask?
Anyway, we don't find other driver users for this, hardly I can
convince you it is worth.
Thanks
Barry
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dma-mapping: make map_benchmark compile into module
2021-03-24 7:33 ` Song Bao Hua (Barry Song)
@ 2021-04-02 14:44 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2021-04-02 14:44 UTC (permalink / raw)
To: Song Bao Hua (Barry Song)
Cc: paulmck, peterz, ast, rostedt, linux-kernel, iommu, tglx,
tiantao (H),
akpm, Christoph Hellwig
On Wed, Mar 24, 2021 at 07:33:23AM +0000, Song Bao Hua (Barry Song) wrote:
> The requirement comes from an colleague who is frequently changing
> the map-bench code for some customized test purpose. and he doesn't
> want to build kernel image and reboot every time. So I moved the
> requirement to Tao Tian.
>
> Right now, kthread_bind() is exported, kthread_bind_mask() seems
> to be a little bit "internal" as you said, maybe a wrapper like
> kthread_bind_node() won't be that "internal", comparing to exposing
> the cpumask?
I really don't think we should be exporting more low-level kthread
APIs. Especially as we've been trying to get most users off the
kthread API and to workqueues instead.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-02 14:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 2:17 [PATCH] dma-mapping: make map_benchmark compile into module Tian Tao
2021-03-24 2:30 ` Song Bao Hua (Barry Song)
2021-03-24 7:13 ` Christoph Hellwig
2021-03-24 7:33 ` Song Bao Hua (Barry Song)
2021-04-02 14:44 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).