public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dan Maas" <dmaas@dcine.com>
To: <linux-kernel@vger.kernel.org>
Subject: forcibly unmap pages in driver?
Date: Mon, 4 Jun 2001 22:31:50 -0400	[thread overview]
Message-ID: <04ea01c0ed67$ad3f38f0$0701a8c0@morph> (raw)

I am writing a device driver that, like many others, exposes a shared memory
region to user-space via mmap(). The region is allocated with vmalloc(), the
pages are marked reserved, and the user-space mapping is implemented with
remap_page_range().

In my driver, I may have to free the underlying vmalloc() region while the
user-space program is still running. I need to remove the user-space
mapping -- otherwise the user process would still have access to the
now-freed pages. I need an inverse of remap_page_range().

Is zap_page_range() the function I am looking for? Unfortunately it's not
exported to modules =(. As a quick fix, I was thinking I could just remap
all of the user pages to point to a zeroed page or something...

Another question- in the mm.c sources, I see that many of the memory-mapping
functions are surrounded by calls to flush_cache_range() and
flush_tlb_range(). But I don't see these calls in many drivers. Is it
necessary to make them when my driver maps or unmaps the shared memory
region?

Regards,
Dan


             reply	other threads:[~2001-06-05  2:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-05  2:31 Dan Maas [this message]
2001-06-05 22:21 ` forcibly unmap pages in driver? Pete Wyckoff
2001-06-05 23:15   ` Dan Maas
2001-06-05 23:31     ` Pete Wyckoff
2001-06-06  0:13       ` Dan Maas
2001-06-06  8:07   ` Martin Diehl
     [not found] <fa.fk487iv.1d2ksb0@ifi.uio.no>
     [not found] ` <fa.f3ckgov.ti0mb3@ifi.uio.no>
2001-06-07  3:46   ` Dan Maas

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='04ea01c0ed67$ad3f38f0$0701a8c0@morph' \
    --to=dmaas@dcine.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