Re: shm in 2.1.125

Christoph Rohland (hans-christoph.rohland@sap-ag.de)
11 Oct 1998 11:39:57 +0200


alan@lxorguk.ukuu.org.uk (Alan Cox) writes:

> > Unfortunately the changes for 2.1.125 did extend the maximum possible
> > SHM segment size from (128M - 1 page) to 128M and make a misconfigured
> > kernel behave very bad!
>
> I doubt very much you'd have gotten to 128Mb before. That would require
> a big multiple allocation to succeed reliably which it may not. Vmalloc
> made the 128M reliable.

I got to it but of course you are right it was not reliable.

> > Since shmid_ds is shared with user space we cannot change it easily.
> >
> > Any ideas?
>
> This cleans up the copy*user stuff in shm.c creates the seperate
> kernel and user structures as I proposed and compiles. I've not tested it
> yet. I need to install another disk to be able to allocate a block big
> enough to test ;)
>
> See if this looks ok and works for you

Seems to work for me on my small machine (never touched all the
memory). I will check next week in real life.

I would suggest the following change to be reliable :-) on shmctl:

@@ -123,6 +123,7 @@
shp->u.shm_lpid = shp->u.shm_nattch = 0;
shp->u.shm_atime = shp->u.shm_dtime = 0;
shp->u.shm_ctime = CURRENT_TIME;
+ shp->u.shm_npages = 0;
shp->shm_npages = numpages;

if (id > max_shmid)

Cheers
Christoph

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/