* [PATCH] kthread: Export kthread_data()
@ 2018-02-09 14:52 Waiman Long
2018-02-12 9:24 ` Peter Zijlstra
2018-02-13 15:50 ` Christoph Hellwig
0 siblings, 2 replies; 5+ messages in thread
From: Waiman Long @ 2018-02-09 14:52 UTC (permalink / raw)
To: Thomas Gleixner, Linus Torvalds, Tejun Heo, Ingo Molnar
Cc: linux-kernel, Waiman Long
When multiple kernel threads are created to cooperatively work on
a common task, we may need a convenient way to access data that are
specific to each kthread.
The kthread_data() function fits this need. However, it was not
visible to kthreads started in a kernel module. To solve this problem,
the kthread_data() function is now exported allowing kthreads from
kernel modules to use it.
Signed-off-by: Waiman Long <longman@redhat.com>
---
kernel/kthread.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/kthread.c b/kernel/kthread.c
index cd50e99..a71d461 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -156,6 +156,7 @@ void *kthread_data(struct task_struct *task)
{
return to_kthread(task)->data;
}
+EXPORT_SYMBOL(kthread_data);
/**
* kthread_probe_data - speculative version of kthread_data()
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] kthread: Export kthread_data()
2018-02-09 14:52 [PATCH] kthread: Export kthread_data() Waiman Long
@ 2018-02-12 9:24 ` Peter Zijlstra
2018-02-13 15:50 ` Christoph Hellwig
1 sibling, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2018-02-12 9:24 UTC (permalink / raw)
To: Waiman Long
Cc: Thomas Gleixner, Linus Torvalds, Tejun Heo, Ingo Molnar,
linux-kernel
On Fri, Feb 09, 2018 at 09:52:21AM -0500, Waiman Long wrote:
> When multiple kernel threads are created to cooperatively work on
> a common task, we may need a convenient way to access data that are
> specific to each kthread.
>
> The kthread_data() function fits this need. However, it was not
> visible to kthreads started in a kernel module. To solve this problem,
> the kthread_data() function is now exported allowing kthreads from
> kernel modules to use it.
No. Without an in-tree user, no export.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kthread: Export kthread_data()
2018-02-09 14:52 [PATCH] kthread: Export kthread_data() Waiman Long
2018-02-12 9:24 ` Peter Zijlstra
@ 2018-02-13 15:50 ` Christoph Hellwig
2018-02-13 21:40 ` Waiman Long
1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2018-02-13 15:50 UTC (permalink / raw)
To: Waiman Long
Cc: Thomas Gleixner, Linus Torvalds, Tejun Heo, Ingo Molnar,
linux-kernel
On Fri, Feb 09, 2018 at 09:52:21AM -0500, Waiman Long wrote:
> When multiple kernel threads are created to cooperatively work on
> a common task, we may need a convenient way to access data that are
> specific to each kthread.
>
> The kthread_data() function fits this need. However, it was not
> visible to kthreads started in a kernel module. To solve this problem,
> the kthread_data() function is now exported allowing kthreads from
> kernel modules to use it.
Please send this along wit hthe actual user of it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kthread: Export kthread_data()
2018-02-13 15:50 ` Christoph Hellwig
@ 2018-02-13 21:40 ` Waiman Long
2018-02-13 21:42 ` Waiman Long
0 siblings, 1 reply; 5+ messages in thread
From: Waiman Long @ 2018-02-13 21:40 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Thomas Gleixner, Linus Torvalds, Tejun Heo, Ingo Molnar,
linux-kernel
On 02/13/2018 10:50 AM, Christoph Hellwig wrote:
> On Fri, Feb 09, 2018 at 09:52:21AM -0500, Waiman Long wrote:
>> When multiple kernel threads are created to cooperatively work on
>> a common task, we may need a convenient way to access data that are
>> specific to each kthread.
>>
>> The kthread_data() function fits this need. However, it was not
>> visible to kthreads started in a kernel module. To solve this problem,
>> the kthread_data() function is now exported allowing kthreads from
>> kernel modules to use it.
> Please send this along wit hthe actual user of it.
It is the developers of the dm-vdo/kvdo modules that would like to use
the kthread_data() function. See
https://github.com/dm-vdo/kvdo
Those modules have a bunch of kernel threads working on block storage
deduplication/compression.
-Longman
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kthread: Export kthread_data()
2018-02-13 21:40 ` Waiman Long
@ 2018-02-13 21:42 ` Waiman Long
0 siblings, 0 replies; 5+ messages in thread
From: Waiman Long @ 2018-02-13 21:42 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Thomas Gleixner, Linus Torvalds, Tejun Heo, Ingo Molnar,
linux-kernel
On 02/13/2018 04:40 PM, Waiman Long wrote:
> On 02/13/2018 10:50 AM, Christoph Hellwig wrote:
>> On Fri, Feb 09, 2018 at 09:52:21AM -0500, Waiman Long wrote:
>>> When multiple kernel threads are created to cooperatively work on
>>> a common task, we may need a convenient way to access data that are
>>> specific to each kthread.
>>>
>>> The kthread_data() function fits this need. However, it was not
>>> visible to kthreads started in a kernel module. To solve this problem,
>>> the kthread_data() function is now exported allowing kthreads from
>>> kernel modules to use it.
>> Please send this along wit hthe actual user of it.
> It is the developers of the dm-vdo/kvdo modules that would like to use
> the kthread_data() function. See
>
> https://github.com/dm-vdo/kvdo
>
> Those modules have a bunch of kernel threads working on block storage
> deduplication/compression.
>
> -Longman
>
BTW, I am fine with not exporting the function. They just have to find
an alternative way of doing it.
-Longman
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-13 21:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-09 14:52 [PATCH] kthread: Export kthread_data() Waiman Long
2018-02-12 9:24 ` Peter Zijlstra
2018-02-13 15:50 ` Christoph Hellwig
2018-02-13 21:40 ` Waiman Long
2018-02-13 21:42 ` Waiman Long
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox