Thank you Hugh for the reply. Last time I used VM_SHM was in 2.2.x kernels.
I have a programme called DIPC which makes System V shared memory segments
(and also messages and semaphores) work over a network.
In the arch/xyz/mm/fault.c file, it checks the VM_SHM flag and then calls
its logic. As a substitute I've been trying this ad-hoc code to see if a vma
represents a Sys V shm:
file = vma->vm_file;
if(file && (file->f_dentry) && (file->f_dentry->d_inode) &&
(id = file->f_dentry->d_inode->i_ino)) {
shp = shm_lock(id);
if(shp == NULL)
return 0; // not a Sys V shm
}
else return 0; // not a Sys V shm
But the kernel hangs with an invalid-pointer error message. Any suggestions?
-Kamran
On Tue, 28 Feb 2006, Kamran Karimi wrote:
>
> VM_SHM is used by DIPC to quickly recognise when we are dealing with a
System
> V IPC segment. It has been "removed" from recent kernels (set to 0).
Curious: VM_SHM wasn't set on a System V IPC shm vma in any 2.4 or 2.6
kernel that I know of; but was set on the vmas of a random collection
of drivers. Perhaps you've been using your own patch to set it on
SysV IPC shm vmas, and clear it from drivers' vmas?
(We'll remove VM_SHM entirely once I've trawled through those drivers.)
> Is there an easy way to find out if a segment is a Sys V shm?
Nothing easy and reliable springs immediately to mind - from a VM point
of view, they're treated much the same as tmpfs files; but there
probably is some hacky way if we think about it long enough.
> if not, I suggest we re-activate it.
It seems that either you've been doing the wrong thing up to now,
and never noticed it; or that you've been using your own flag in
your own patch, and can continue to do so. No need for vanilla
kernel to reinstate VM_SHM.
Are you sure you need to recognize them?
Hugh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]