mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kamran Karimi" <kamrankarimi@hotmail.com>
To: hugh@veritas.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: why VM_SHM has been removed from mm.h?
Date: Wed, 01 Mar 2006 08:58:39 -0600	[thread overview]
Message-ID: <BAY104-F540D2AB4A73950CA9891BC0F40@phx.gbl> (raw)
In-Reply-To: <Pine.LNX.4.61.0603010741200.7184@goblin.wat.veritas.com>

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



  reply	other threads:[~2006-03-01 14:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <op.s5cj47sxj68xd1@mail.piments.com>
     [not found] ` <op.s5jpqvwhui3qek@mail.piments.com>
     [not found]   ` <op.s5kxhyzgfx0war@mail.piments.com>
     [not found]     ` <op.s5kx7xhfj68xd1@mail.piments.com>
     [not found]       ` <op.s5kya3t0j68xd1@mail.piments.com>
     [not found]         ` <op.s5ky2dbcj68xd1@mail.piments.com>
     [not found]           ` <op.s5ky71nwj68xd1@mail.piments.com>
     [not found]             ` <op.s5kzao2jj68xd1@mail.piments.com>
2006-02-26 22:50               ` o_sync in vfat driver col-pepper
2006-02-27 13:28                 ` Lennart Sorensen
2006-02-27 13:50                   ` Arjan van de Ven
2006-02-27 14:06                     ` Anton Altaparmakov
2006-02-27 14:27                       ` Arjan van de Ven
2006-02-27 14:41                         ` Anton Altaparmakov
2006-02-27 21:04                           ` col-pepper
2006-02-27 21:17                             ` Arjan van de Ven
2006-02-27 23:21                               ` col-pepper
2006-02-27 21:32                             ` linux-os (Dick Johnson)
2006-02-27 23:21                               ` col-pepper
2006-02-28 13:10                                 ` linux-os (Dick Johnson)
2006-02-28 13:52                                   ` Sergei Organov
2006-02-28 15:18                                   ` Lennart Sorensen
2006-02-28 16:16                                     ` linux-os (Dick Johnson)
2006-02-28 17:23                                       ` Sergei Organov
2006-02-28 18:09                                       ` Krzysztof Halasa
2006-02-28 17:16                                   ` col-pepper
2006-02-28 22:38                                 ` Pavel Machek
2006-02-28 23:10                                   ` why VM_SHM has been removed from mm.h? Kamran Karimi
2006-03-01  3:02                                     ` Phillip Susi
2006-03-01  7:56                                     ` Hugh Dickins
2006-03-01 14:58                                       ` Kamran Karimi [this message]
2006-03-01 16:24                                         ` Hugh Dickins
2006-03-01 16:55                                           ` Kamran Karimi
2006-03-01 17:50                                             ` Hugh Dickins
2006-03-01  4:28                                   ` o_sync in vfat driver Kyle Moffett
2006-03-02  8:23                                   ` col-pepper
2006-03-02  8:32                                     ` Pavel Machek
2006-02-28 16:11                             ` Helge Hafting
2006-02-28 22:37                             ` Pavel Machek
2006-02-27 14:26                   ` linux-os (Dick Johnson)
2006-02-27 18:53                     ` Jan Engelhardt

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=BAY104-F540D2AB4A73950CA9891BC0F40@phx.gbl \
    --to=kamrankarimi@hotmail.com \
    --cc=hugh@veritas.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

all inboxes | Powered by JetHome®