Greg Lopp on Mon, 13 Mar 2000 16:38:26 -0500 (EST)


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

Re: [PLUG] shmget


Greg Lopp wrote:

> mg@infinity.stf.org wrote:
>
> > Doh! Sorry about that previous message. Stupid pine :)
> >
> > Anyways, after upgrading to kernel 2.3.51, I've been seeing the following
> > in syslog all the time.
> >
> > Mar 13 15:41:49 infinity kernel: shmget: shm filesystem not mounted
> > Mar 13 15:42:17 infinity last message repeated 47 times
> > Mar 13 15:43:31 infinity last message repeated 23 times
> >
> > Anyone know what's up with that? Have I not enabled something in the
> > kernel that I should have?
> >
>
> Just did a quick search on "shm filesystem"at deja.com.....
>
> One poster claims a similar problem was resolved by adding the following to
> his /etc/fstab
>
> none            /var/shm        shm    defaults                    0      0
>
> Is shared memory going the way of /dev/ptymx in the 2.3.5x series?   i.e.
> the same way that an open request to /dev/ptymx returns an unused pty, a
> reference to /var/shm is how shared memory segments are
> attached/manipulated?
>
> Anybody know anything about the shm filesystem?
>

I'll just answer my own question :
 --=-=-= --=-=-= --=-=-=

 Subject:  [PATCH] replace SYSV shared memory with shm filesystem
 Date: 01/11/2000
 Author: Christoph Rohland <hans-christoph.rohland@sap.com>

 Hi folks,

 This patch implements a minimal filesystem for shared memory. It
 replaces/reuses the existing SYSV shm code so you now have to
 mount the fs to be able to use SYSV SHM. But in turn we now have
 everything in place to implement posix shm. This also obsoletes
 vm_private_data in vm_area_struct.

 Also it is now possible to do e.g. 'rm /dev/shm/*' instead of this
 terrible 'ipcrm shm xx' :-)

 You can mount the fs only once. This will probably break shm in
 chrooted environments.

 It is heavily tested from UP to 8way SMP with HIGHMEM. On the
 latter the shm handling triggers some mm bugs under heavy
 swapping. But these problems also exists in the stock 2.3.36 kernel (I
 cannot boot
 2.3.3[78] on my 8way). I will report these problems later in a
 separate mail.

 --=-=-= --=-=-= --=-=-=
Christoph pastes in his patch, discussion of all things shm unsues (not for a
layman like myself) and on 3/10/00 the following  patch is posted to fix a
discrepancy with linux/fs.h :

 - --- ipc/shm.c  Fri Mar 10 07:29:27 2000
 +++ ipc/shm.c.new  Fri Mar 10 08:30:43 2000
 @@ -48,7 +48,7 @@
 static int          shm_remount_fs (struct super_block *, int *, char *);
 static void          shm_read_inode (struct inode *);
 static void          shm_write_inode(struct inode *);
 - -static int          shm_statfs (struct super_block *, struct statfs *,
int);
 +static int          shm_statfs (struct super_block *, struct statfs *);
 static int          shm_create  (struct inode *,struct dentry *,int); static
struct dentry
 *shm_lookup  (struct inode *,struct dentry *); static int
shm_unlink  (struct
 inode *,struct dentry *); @@ -338,18 +338,15 @@
         up(&shm_ids.sem);
 }

 - -static int shm_statfs(struct super_block *sb, struct statfs *buf, int
bufsiz)
 +static int shm_statfs(struct super_block *sb, struct statfs *buf) {
 - -      struct statfs tmp;
 - -
 - -      tmp.f_type = 0;
 - -      tmp.f_bsize = PAGE_SIZE;
 - -      tmp.f_blocks = shm_ctlall;
 - -      tmp.f_bavail = tmp.f_bfree = shm_ctlall - shm_tot;
 - -      tmp.f_files = shm_ctlmni;
 - -      tmp.f_ffree = shm_ctlmni - used_segs;
 - -      tmp.f_namelen = SHM_NAME_LEN;
 - -      return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0; +
buf->f_bsize
 = PAGE_SIZE;
 +      buf->f_blocks = shm_ctlall;
 +      buf->f_bavail = tmp.f_bfree = shm_ctlall - shm_tot;
 +      buf->f_files = shm_ctlmni;
 +      buf->f_ffree = shm_ctlmni - used_segs;
 +      buf->f_namelen = SHM_NAME_LEN;
 +      return 0;
 }

 static void shm_write_inode(struct inode * inode)


For the record, the need to mount /dev/shm (which makes more since than my
previous example with /ver/shm) is documented in linux/Documentation/Changes.


______________________________________________________________________
Philadelphia Linux Users Group       -       http://plug.nothinbut.net
Announcements - http://lists.nothinbut.net/mail/listinfo/plug-announce
General Discussion   -   http://lists.nothinbut.net/mail/listinfo/plug