Re: Reg kmap()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2007-01-20 at 10:29 +0530, Rick Brown wrote:
> On 1/20/07, Arjan van de Ven <arjan@xxxxxxxxxxxxx> wrote:
> > On Fri, 2007-01-19 at 15:13 -0800, Karthik.G. wrote:
> > > Hi,
> > > I have a small question reg kmap()
> > > Suppose i map a user process page into kernel mem using kmap()
> > > and after the mapping the user modifies the contents ,would it be read
> > > by the  kernel.
> > > Or everytime the user changes something in his address space,the
> > > kernel has to unmap and then do a kmap again?`
> >
> > this depends on the architecture; on x86 you'll see it (by luck), on
> > others... hardly.
> >
> > I assume you've made very sure the user can't just munmap the page while
> > you have it kmap()'d ... what would mean you'd be looking at someone
> > elses memory :)
> >
> 
> Uh, I'm sorry ... but I couldn't understand the scenario well. Karthik
> was not talking about user application using mmap(), was he? I think
> he was talking about a normal user space address (e.g. user space
> stack) being kmapped into kernel, right?


so you have a threaded application.
Thread 0 goes into the kernel on cpu 0, and you do the kmap thing on a
piece of memory from the userspace address space
Thread 1 runs on cpu 1 and does an munmap() on that exact piece of
memory (or the range it's in) and the memory gets freed by the kernel
and returned to the free memory pool and then quickly reused (it's LIFO)

 
-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux