public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Block" <andreas.block@esd-electronics.com>
To: linux-kernel@vger.kernel.org
Subject: munmap from inside kernel
Date: Thu, 21 Sep 2006 10:04:12 +0200	[thread overview]
Message-ID: <op.tf7x1ae18n9ctc@pc-block.esd> (raw)

Hi,

following scenario:
Two linux systems connected via PCI.
I'd like to write a driver, which allows to map memory from the remote  
system into local user space and vice versa.
This works quite well utilizing mmap and respective vma_ops.
I do have one problem though. When the buffer on the remote side gets  
destroyed, I'd like to remove the mappings from local user space into this  
buffer (I do prefer a segfaulting application over an application writing  
into "I don't know where").
Under kernel 2.4.x I used "do_munmap()" in protection of "mm->mmap_sem"  
and it seemed to work quite well for me.
Now using kernel 2.6.x (I tested 2.6.8 and 2.6.15) this seemingly doesn't  
work anymore, because I do end up with a crash, when trying to manually  
unmap the memory.

Is there any safe way to "trigger munmap()" from inside the kernel?

Best regards,
Andreas

                 reply	other threads:[~2006-09-21  8:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.tf7x1ae18n9ctc@pc-block.esd \
    --to=andreas.block@esd-electronics.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox