why mprotect(PROT_SEM) ?
"Dr. Uwe Girlich" <[email protected]>
| Newsgroups | gmane.linux.ngpt.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello list! In my quest to remove (or at least handle the size dynamically) of /dev/shm/ngpt I just read about sys_futex.c/sys_futex_region() and found, it calls in the end only mprotect(area, size, PROT_READ|PROT_WRITE|PROT_SEM); The read and write protection should be OK anyway (the file /dev/shm/ngpt itself has access rights 666) so the only interesting point here is PROT_SEM. This macro came new into the kernel with the futex patch. It is defined in asm-(IBM-architectures)/mman.h as #define PROT_SEM 0x8 /* page may be used for atomic ops */ and used only once: in mm/mprotect.c/sys_mprotect() this new flag is also allowed but nobody does anything with it. So what can we learn from this? Is this mprotect() call necessary at all? May it be, that other architectures may need to prepare something more to allow atomic operations in user pages? Bye, Uwe -- Dr. Uwe Girlich email: [email protected] Philosys Software GmbH www: www.philosys.de Edisonstrasse 6 phone: +49 89 321407-44 D-85716 Unterschleissheim fax: +49 89 321407-12