All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Chris Friesen <cfriesen@nortelnetworks.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: question on memory map cleanup stuff
Date: Mon, 18 Oct 2004 16:14:32 -0700	[thread overview]
Message-ID: <20041018231432.GI5607@holomorphy.com> (raw)
In-Reply-To: <41744A50.3030700@nortelnetworks.com>

On Mon, Oct 18, 2004 at 04:57:20PM -0600, Chris Friesen wrote:
> I've got a small feature that maps a page of kernel memory to userspace via 
> a syscall, then uses that page for various things.
> Currently, I'm marking the page reserved, then exporting it via 
> remap_page_range().  This means that I need to clean up my mapping whenever 
> the memory map is destroyed (process death, exec(), daemonize, etc.).
> It appears that I should be able to put my cleanup code in exit_mmap().  
> Since the cleanup code calls do_munmap() on the address, I would want to 
> call it before taking mm->page_table_lock, correct?
> Also, normally I would hold mm->mmap_sem before calling do_munmap().  Would 
> I still need this if I'm calling it from exit_mmap()?  Presumably nobody 
> else can get at it anymore...

vma->vm_ops->close() often suffices for such without disturbing the core.


-- wli

  reply	other threads:[~2004-10-18 23:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 22:57 question on memory map cleanup stuff Chris Friesen
2004-10-18 23:14 ` William Lee Irwin III [this message]
2004-10-18 23:39   ` Chris Friesen
2004-10-19 18:19   ` Chris Friesen
2004-10-19 18:24     ` William Lee Irwin III

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=20041018231432.GI5607@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=cfriesen@nortelnetworks.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.