public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* intercommunications between Linux kernel modules
@ 2011-10-07  1:53 Cyclonus J
  2011-10-07  2:04 ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: Cyclonus J @ 2011-10-07  1:53 UTC (permalink / raw)
  To: linux-kernel

hi,

I am looking for a way to do an IPC-like communications between two
linux kernel modules, such as mqueue or shared memory. After searching
for a while, I can't find such information available inside existing
linux kernel or online.

So, my question is if this is something discussed before here and gets
rejected or still might be accepted in the mainstream kernel tree?

Thanks,
CJ

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: intercommunications between Linux kernel modules
  2011-10-07  1:53 intercommunications between Linux kernel modules Cyclonus J
@ 2011-10-07  2:04 ` Andi Kleen
  2011-10-07  2:59   ` Cyclonus J
  0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2011-10-07  2:04 UTC (permalink / raw)
  To: Cyclonus J; +Cc: linux-kernel

Cyclonus J <cyclonusj@gmail.com> writes:

> I am looking for a way to do an IPC-like communications between two
> linux kernel modules, such as mqueue or shared memory. After searching
> for a while, I can't find such information available inside existing
> linux kernel or online.
>
> So, my question is if this is something discussed before here and gets
> rejected or still might be accepted in the mainstream kernel tree?

All kernel memory is shared in Linux, so the concept doesn't make sense.

If you want to send messages or communicate inside the kernel there are
lots of different facilities available.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: intercommunications between Linux kernel modules
  2011-10-07  2:04 ` Andi Kleen
@ 2011-10-07  2:59   ` Cyclonus J
  2011-10-07  4:00     ` david
  0 siblings, 1 reply; 6+ messages in thread
From: Cyclonus J @ 2011-10-07  2:59 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

On Thu, Oct 6, 2011 at 7:04 PM, Andi Kleen <andi@firstfloor.org> wrote:
> Cyclonus J <cyclonusj@gmail.com> writes:
>
>> I am looking for a way to do an IPC-like communications between two
>> linux kernel modules, such as mqueue or shared memory. After searching
>> for a while, I can't find such information available inside existing
>> linux kernel or online.
>>
>> So, my question is if this is something discussed before here and gets
>> rejected or still might be accepted in the mainstream kernel tree?
>
> All kernel memory is shared in Linux, so the concept doesn't make sense.
>
> If you want to send messages or communicate inside the kernel there are
> lots of different facilities available.

Andi,

That would be great! Could you point me to some facilities that can do
this message passing between kernels?

Thanks,
CJ

>
> -Andi
> --
> ak@linux.intel.com -- Speaking for myself only
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: intercommunications between Linux kernel modules
  2011-10-07  2:59   ` Cyclonus J
@ 2011-10-07  4:00     ` david
  2011-10-07  4:10       ` Cyclonus J
  0 siblings, 1 reply; 6+ messages in thread
From: david @ 2011-10-07  4:00 UTC (permalink / raw)
  To: Cyclonus J; +Cc: Andi Kleen, linux-kernel

On Thu, 6 Oct 2011, Cyclonus J wrote:

> On Thu, Oct 6, 2011 at 7:04 PM, Andi Kleen <andi@firstfloor.org> wrote:
>> Cyclonus J <cyclonusj@gmail.com> writes:
>>
>>> I am looking for a way to do an IPC-like communications between two
>>> linux kernel modules, such as mqueue or shared memory. After searching
>>> for a while, I can't find such information available inside existing
>>> linux kernel or online.
>>>
>>> So, my question is if this is something discussed before here and gets
>>> rejected or still might be accepted in the mainstream kernel tree?
>>
>> All kernel memory is shared in Linux, so the concept doesn't make sense.
>>
>> If you want to send messages or communicate inside the kernel there are
>> lots of different facilities available.
>
> Andi,
>
> That would be great! Could you point me to some facilities that can do
> this message passing between kernels?

what you are missing is that there aren't two different kernels. it's one 
big process. think multi-threaded programming instead of inter-process 
communication. You don't even have well defined threads to work with so 
you can't say "I'm in thread 1 and need to communicate with thread 2", you 
need to think "I'm in this routine and I need to set a message in a way 
that another routine will read it", this can be as simple as just setting 
a variable (although you do need to make it the equivalent of 'thread 
safe' through appropriate locking or lock-free protection)

David Lang

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: intercommunications between Linux kernel modules
  2011-10-07  4:00     ` david
@ 2011-10-07  4:10       ` Cyclonus J
  2011-10-07 17:41         ` Christoph Lameter
  0 siblings, 1 reply; 6+ messages in thread
From: Cyclonus J @ 2011-10-07  4:10 UTC (permalink / raw)
  To: david; +Cc: Andi Kleen, linux-kernel

On Thu, Oct 06, 2011 at 09:00:13PM -0700, david@lang.hm wrote:
> On Thu, 6 Oct 2011, Cyclonus J wrote:
> 
> >On Thu, Oct 6, 2011 at 7:04 PM, Andi Kleen <andi@firstfloor.org> wrote:
> >>Cyclonus J <cyclonusj@gmail.com> writes:
> >>
> >>>I am looking for a way to do an IPC-like communications between two
> >>>linux kernel modules, such as mqueue or shared memory. After searching
> >>>for a while, I can't find such information available inside existing
> >>>linux kernel or online.
> >>>
> >>>So, my question is if this is something discussed before here and gets
> >>>rejected or still might be accepted in the mainstream kernel tree?
> >>
> >>All kernel memory is shared in Linux, so the concept doesn't make sense.
> >>
> >>If you want to send messages or communicate inside the kernel there are
> >>lots of different facilities available.
> >
> >Andi,
> >
> >That would be great! Could you point me to some facilities that can do
> >this message passing between kernels?
> 
> what you are missing is that there aren't two different kernels.
> it's one big process. think multi-threaded programming instead of
> inter-process communication. You don't even have well defined
> threads to work with so you can't say "I'm in thread 1 and need to
> communicate with thread 2", you need to think "I'm in this routine
> and I need to set a message in a way that another routine will read
> it", this can be as simple as just setting a variable (although you
> do need to make it the equivalent of 'thread safe' through
> appropriate locking or lock-free protection)

David,

Yes, it is multi-threaded. I have two kernel modules and each of them will
create its own kernel thread just for communication purpose (message passing).

Do you know if there is any message primitves I can use to achieve this inside
kernel?

Thanks,
CJ

> 
> David Lang

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: intercommunications between Linux kernel modules
  2011-10-07  4:10       ` Cyclonus J
@ 2011-10-07 17:41         ` Christoph Lameter
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2011-10-07 17:41 UTC (permalink / raw)
  To: Cyclonus J; +Cc: david, Andi Kleen, linux-kernel

On Thu, 6 Oct 2011, Cyclonus J wrote:

> Yes, it is multi-threaded. I have two kernel modules and each of them will
> create its own kernel thread just for communication purpose (message passing).
>
> Do you know if there is any message primitves I can use to achieve this inside
> kernel?

F.e. Use the lockless lists in linux/include/llist.h?

Anything else will work too. Just declare a variable and access it from
both threads.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-10-07 17:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07  1:53 intercommunications between Linux kernel modules Cyclonus J
2011-10-07  2:04 ` Andi Kleen
2011-10-07  2:59   ` Cyclonus J
2011-10-07  4:00     ` david
2011-10-07  4:10       ` Cyclonus J
2011-10-07 17:41         ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox