linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Accessing shared memory in a kernel module
@ 2000-05-23 16:16 Stephane Letz
  2000-05-23 16:42 ` Benjamin C.R. LaHaise
  0 siblings, 1 reply; 3+ messages in thread
From: Stephane Letz @ 2000-05-23 16:16 UTC (permalink / raw)
  To: linux-mm

We are developing an application where we need to access shared memory both
in user space and in a kernel module.  We use a shared memory segment to
preallocate memory cells which are later communicated between several
applications in user space.  These memory cells are time stamped and use a
reference counter. To exchange cells between applications in user space,
they are first inserted in a scheduler  (located in a kernel module) to be
delivered to the destination application at the right time.
The kernel module need to access the reference counter field of each cell.

We tried to use standard shmxx functions to manage shared memory and it
work OK in user space, but we can not access the cell content in the kernel
context.

How can that be done?

Thanks in advance for any advice

Stephane Letz


Grame: Centre National de creation musicale
9, Rue du Garet
69001 Lyon
Tel: 04-72-07-37-00
Fax: 04-72-07-37-01
Web: www.grame.fr


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

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

* Re: Accessing shared memory in a kernel module
  2000-05-23 16:16 Accessing shared memory in a kernel module Stephane Letz
@ 2000-05-23 16:42 ` Benjamin C.R. LaHaise
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin C.R. LaHaise @ 2000-05-23 16:42 UTC (permalink / raw)
  To: Stephane Letz; +Cc: linux-mm

On Tue, 23 May 2000, Stephane Letz wrote:

> We tried to use standard shmxx functions to manage shared memory and it
> work OK in user space, but we can not access the cell content in the kernel
> context.

Which kernel context -- a kernel thread?  Access to shared memory segments
is only possible from the context of a process that has mapped the shared
memory segment into its address space.  From such a context, it is
possible to make a kiobuf mapping that locks down the memory and allows
the kernel to access it.  It might be easier to solve the problem
differently as memory mapping operations should not be over used.

		-ben

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

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

* Re: Accessing shared memory in a kernel module
       [not found] <v0300780ab55062f164db@[194.5.49.5]>
@ 2000-05-23 16:59 ` Benjamin C.R. LaHaise
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin C.R. LaHaise @ 2000-05-23 16:59 UTC (permalink / raw)
  To: Stephane Letz; +Cc: linux-mm

On Tue, 23 May 2000, Stephane Letz wrote:

> We need to access to  shared memory segment in the kernel but not in the
> context of a user space process call. Actually the user application send a
> shared memory cell in the kernel module and "later" (in the context of a
> kernel timer interrupt), the kernel module needs to access the memory cell
> and give it back to another user application.
> 
> Any idea?

Without knowing more of what you're trying to do, I'll give the generic
advice of allocate the memory in your driver at startup (open or configure
time) and provide an mmap method -- see the sound drivers et al.

		-ben

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

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

end of thread, other threads:[~2000-05-23 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-23 16:16 Accessing shared memory in a kernel module Stephane Letz
2000-05-23 16:42 ` Benjamin C.R. LaHaise
     [not found] <v0300780ab55062f164db@[194.5.49.5]>
2000-05-23 16:59 ` Benjamin C.R. LaHaise

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