* Changes in vm_operations_struct 2.2.x => 2.4.x @ 2001-08-03 8:01 Martin Maletinsky 2001-08-08 22:49 ` Ingo Oeser 0 siblings, 1 reply; 4+ messages in thread From: Martin Maletinsky @ 2001-08-03 8:01 UTC (permalink / raw) To: kernelnewbies, linux-mm Hi, Playing around with kernel memory allocated by a module and mmap()ed by a user space process, I noticed that in the 2.4.x kernel many of the 2.2.x vm_operation_struct fields have gone. In particular there is no unmap operation any more. Is there any way for a driver to get notified when the user space process mapping memory exported by the driver unmaps parts of that memory (as far as I know, the close operation is invoked when the entire memory is unmapped)? Does anyone know the reason why the number of operations in vm_operation_struct has been reduced? regards Martin -- Supercomputing System AG email: maletinsky@scs.ch Martin Maletinsky phone: +41 (0)1 445 16 05 Technoparkstrasse 1 fax: +41 (0)1 445 16 10 CH-8005 Zurich -- 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-mm.org/ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changes in vm_operations_struct 2.2.x => 2.4.x 2001-08-03 8:01 Changes in vm_operations_struct 2.2.x => 2.4.x Martin Maletinsky @ 2001-08-08 22:49 ` Ingo Oeser 2001-08-09 7:02 ` Martin Maletinsky 0 siblings, 1 reply; 4+ messages in thread From: Ingo Oeser @ 2001-08-08 22:49 UTC (permalink / raw) To: Martin Maletinsky; +Cc: kernelnewbies, linux-mm On Fri, Aug 03, 2001 at 10:01:22AM +0200, Martin Maletinsky wrote: > Does anyone know the reason why the number of operations in > vm_operation_struct has been reduced? Al Viro reduced it, because nobody used them for several years. Nobody complained after removing them, also. Maybe you can explain more, what you try to do in your module and people can help you. Regards Ingo Oeser -- 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-mm.org/ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changes in vm_operations_struct 2.2.x => 2.4.x 2001-08-08 22:49 ` Ingo Oeser @ 2001-08-09 7:02 ` Martin Maletinsky 2001-08-09 12:24 ` Thomas Hofer 0 siblings, 1 reply; 4+ messages in thread From: Martin Maletinsky @ 2001-08-09 7:02 UTC (permalink / raw) To: Ingo Oeser; +Cc: kernelnewbies, linux-mm Hi Ingo, Thank's for your reply. The details are as follows: My module allocates a block of memory, and exports that block to user space processes, by registering as a character device and implementing a mmap file operation, so that user space processes can map that memory block into their virtual address space by calling mmap(). A block of memory may only be mapped through mmap() by one process, subsequent mmap() calls to map that memory block should fail, until the block is no longer mapped into any processes memory (note, that following fork() calls the block may be mapped into the virtual memory space of several processes simultaneously, but this is OK). It would have simplified my job, if I could have assumed that a process has either the entire block mapped into it's virtual address space, or that it has none of the block mapped at all (i.e. there are never fragment's of the block mapped into a process' virtual address space). To ensure that at the time of mapping, I would have checked the length of the processes memory region (vma->vm_end -vma->vm_start) in the module's mmap() file operation. To prevent partial unmapping of the block, I would have registered an unmap() vm_area operation with the vm_area_struct in the module's mmap() file operation. The unmap() vm_area operation would have checked the addr and len parameter, to detect partial unmappings of the memory block by a user process. In case of a partial unmapping of the memory block, unmap() would have simply sent a SIGKILL to the process. Regards Martin Ingo Oeser wrote: > On Fri, Aug 03, 2001 at 10:01:22AM +0200, Martin Maletinsky wrote: > > Does anyone know the reason why the number of operations in > > vm_operation_struct has been reduced? > > Al Viro reduced it, because nobody used them for several years. > Nobody complained after removing them, also. > > Maybe you can explain more, what you try to do in your module and > people can help you. > > Regards > > Ingo Oeser > - > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > IRC Channel: irc.openprojects.net / #kernelnewbies > Web Page: http://www.kernelnewbies.org/ -- Supercomputing System AG email: maletinsky@scs.ch Martin Maletinsky phone: +41 (0)1 445 16 05 Technoparkstrasse 1 fax: +41 (0)1 445 16 10 CH-8005 Zurich -- 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-mm.org/ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changes in vm_operations_struct 2.2.x => 2.4.x 2001-08-09 7:02 ` Martin Maletinsky @ 2001-08-09 12:24 ` Thomas Hofer 0 siblings, 0 replies; 4+ messages in thread From: Thomas Hofer @ 2001-08-09 12:24 UTC (permalink / raw) To: kernelnewbies, linux-mm Martin Maletinsky wrote (Donnerstag, 9. August 2001 09:02): > My module allocates a block of memory, and exports that block to user > space processes, by registering as a character device and > implementing a mmap file operation, so that user space processes can > map that memory block into their virtual address space by calling > mmap(). Would it be possible to do this with shared memory (shmget/shmat)? What's the advantage of making a device and mmaping it? Sounds more complicated. (I did only user-space programs as yet, so forgive me my naivity) Thomas. -- 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-mm.org/ ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-08-09 12:24 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2001-08-03 8:01 Changes in vm_operations_struct 2.2.x => 2.4.x Martin Maletinsky 2001-08-08 22:49 ` Ingo Oeser 2001-08-09 7:02 ` Martin Maletinsky 2001-08-09 12:24 ` Thomas Hofer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox