Increasing shared memory on 1.2.13?

Increasing shared memory on 1.2.13?

Post by Jim Valavani » Wed, 24 Jul 1996 04:00:00




> > How do I go about increasing the shared memory in Linux
> > running 1.2.13 kernel??

> > I believe it only comes with 4MB possible in shared memory after
> > installing this version.  What files do I need to modify before
> > recompiling the kernel to allocate more shared memory?

> There is a define somewhere, just increase it by a factor of 10.
> The GIMP documentation explains it. (GIMP is graphics software)

> Suggestion: Just upgrade. Linux 2 is about _twice_ as fast,
> closer to POSIX (needs testing, but seems 100%), and has many
> important features 1.2 lacked. Though there are of course some
> new bugs, many old bugs were fixed.

> If you must run 1.2, please be sure to add the collected patches.
> (try ftp.nether.net maybe, or search for it) There was a security
> critical bugfix, as well as others.

Well, I've tried increasing the parameters for shared memory with kernel
1.2.13 without success of having more shared memory.
Attached is the file /usr/src/linux/include/linux/shm.h...

Do you have any idea if there are other params I must change??

Thanks a lot for your help!
--
____________________________________________________________________


  \   Kessler/Asher Group at     |   phone (312)786-4779         /
   \  the CBOE                   |   fax (312)786-4776          /      
    ______  _______  _________       __        __       ______
   / ____/ /__  __/ /___  ___/      / /       / /      / ____/
  / /        / /       / /  _____  / /       / /      / /
 / /____  __/ /__     / /  /____/ / /_____  / /____  / /____
/______/ /______/    /_/         /_______/ /______/ /______/

[ shm.h 3K ]
#ifndef _LINUX_SHM_H_
#define _LINUX_SHM_H_
#include <linux/ipc.h>

struct shmid_ds {
        struct ipc_perm shm_perm;       /* operation perms */
        int     shm_segsz;              /* size of segment (bytes) */
        time_t  shm_atime;              /* last attach time */
        time_t  shm_dtime;              /* last detach time */
        time_t  shm_ctime;              /* last change time */
        unsigned short  shm_cpid;       /* pid of creator */
        unsigned short  shm_lpid;       /* pid of last operator */
        short   shm_nattch;             /* no. of current attaches */
        /* the following are private */
        unsigned short   shm_npages;    /* size of segment (pages) */
        unsigned long   *shm_pages;     /* array of ptrs to frames -> SHMMAX */
        struct vm_area_struct *attaches; /* descriptors for attaches */

Quote:};

/* permission flag for shmget */
#define SHM_R           0400    /* or S_IRUGO from <linux/stat.h> */
#define SHM_W           0200    /* or S_IWUGO from <linux/stat.h> */

/* mode for attach */
#define SHM_RDONLY      010000  /* read-only access */
#define SHM_RND         020000  /* round attach address to SHMLBA boundary */
#define SHM_REMAP       040000  /* take-over region on attach */

/* super user shmctl commands */
#define SHM_LOCK        11
#define SHM_UNLOCK      12

struct  shminfo {
    int shmmax;
    int shmmin;
    int shmmni;
    int shmseg;
    int shmall;

Quote:};

/* address range for shared memory attaches if no address passed to shmat() */
#define SHM_RANGE_START 0x50000000
#define SHM_RANGE_END   0x60000000

/* format of page table entries that correspond to shared memory pages
   currently out in swap space (see also mm/swap.c):
   bit 0 (PAGE_PRESENT) is  = 0
   bits 7..1 (SWP_TYPE) are = SHM_SWP_TYPE
   bits 31..8 are used like this:
   bits 14..8 (SHM_ID) the id of the shared memory segment
   bits 29..15 (SHM_IDX) the index of the page within the shared memory segment
                    (actually only bits 24..15 get used since SHMMAX is so low)
*/

#define SHM_ID_SHIFT    8
/* Keep _SHM_ID_BITS as low as possible since SHMMNI depends on it and
   there is a static array of size SHMMNI. */
#define _SHM_ID_BITS    7
#define SHM_ID_MASK     ((1<<_SHM_ID_BITS)-1)

#define SHM_IDX_SHIFT   (SHM_ID_SHIFT+_SHM_ID_BITS)
#define _SHM_IDX_BITS   15
#define SHM_IDX_MASK    ((1<<_SHM_IDX_BITS)-1)

/* We must have SHM_ID_SHIFT + _SHM_ID_BITS + _SHM_IDX_BITS <= 32
   and SHMMAX <= (PAGE_SIZE << _SHM_IDX_BITS). */

#define SHMMAX 0x7F0000                         /* max shared seg size (bytes) */
/* #define SHMMAX 0x3fa000      original                         max shared seg size (bytes) */
#define SHMMIN 1         /* really PAGE_SIZE */ /* min shared seg size (bytes) */
#define SHMMNI (1<<_SHM_ID_BITS)          /* max num of segs system wide */
#define SHMALL (1<<(_SHM_IDX_BITS+_SHM_ID_BITS))/* max shm system wide (pages) */
#define SHMLBA 0x1000                           /* attach addr a multiple of this */
#define SHMSEG SHMMNI                           /* max shared segs per process */

#ifdef __KERNEL__

/* shm_mode upper byte flags */
#define SHM_DEST        01000   /* segment will be destroyed on last detach */
#define SHM_LOCKED      02000   /* segment will not be swapped */

/* ipcs ctl commands */
#define SHM_STAT        13
#define SHM_INFO        14
struct shm_info {
        int   used_ids;
        ulong shm_tot; /* total allocated shm */
        ulong shm_rss; /* total resident shm */
        ulong shm_swp; /* total swapped shm */
        ulong swap_attempts;
        ulong swap_successes;

Quote:};

#endif /* __KERNEL__ */

#endif /* _LINUX_SHM_H_ */

 
 
 

1. Increasing shared memory on 1.2.13?

How do I go about increasing the shared memory in Linux running 1.2.13
kernel??

I believe it only comes with 4MB possible in shared memory after
installing this version.  What files do I need to modify before
recompiling the kernel to allocate more shared memory?

Thanks
--
____________________________________________________________________


  \   Kessler/Asher Group at     |   phone (312)786-4779         /
   \  the CBOE                   |   fax (312)786-4776          /      
    ______  _______  _________       __        __       ______
   / ____/ /__  __/ /___  ___/      / /       / /      / ____/
  / /        / /       / /  _____  / /       / /      / /
 / /____  __/ /__     / /  /____/ / /_____  / /____  / /____
/______/ /______/    /_/         /_______/ /______/ /______/

2. XTerm Question

3. Shared memory on Linux 1.2.13???

4. SSH access without passwords using authorized_keys2

5. strange problems 1.2.13 --> 2.0.0 --> 1.2.13

6. Pre-built kernels

7. Memory usage of 1.2.13 (update)

8. Windows95 PPP dial-up to Solaris 2.5

9. X memory problems 1iwht 1.2.13

10. Linux 1.2.13 and 128mb of memory

11. Memory usage of 1.2.13

12. Linux 1.2.13 will not boot since memory upgrade on laptop

13. Linux 1.2.13 crashes - Memory alloc problem?