mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Semaphore and Shared memory questions...
@ 2002-11-20 21:30 Richard Whittaker
  2002-11-20 22:04 ` Alan Cox
       [not found] ` <sddb931a.041@nwtel.ca>
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Whittaker @ 2002-11-20 21:30 UTC (permalink / raw)
  To: linux-kernel

Greetings:

I'm building a Linux box up for use with Oracle 8i.

The machine I'm using is a Dell Poweredge 2650 server with a pair of Xeon 
Processors, 2GB of RAM, a disk array, etc, etc...

Part of building this machine up is tuning the kernel parameters for 
shmmax, semmni, semmsl, semmns, etc...

In reading, this should be fairly ieasy... Make some changes to 
/usr/include/linux/sem.h and /usr/include/linux/shm.h, recompile, install, 
LILO, reboot, and yer done... Well, my experience wasn't that simple...

Here's a clip of my /usr/include/linux/shm.h

#define SHMMAX 0x3E00000                 /* max shared seg size (bytes) */
#define SHMMIN 1                         /* min shared seg size (bytes) */
#define SHMMNI 4096                      /* max num of segs system wide */
#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
#define SHMSEG SHMMNI                    /* max shared segs per process */

...and what sysctl shows...

root@tom:/usr/include/linux# sysctl -a | grep shmmax
kernel/shmmax = 33554432
root@tom:/usr/include/linux#

I can change this value with sysctl -p at boot time, but I would really 
prefer it to be built into the kernel...

...now for semaphores...

/usr/include/linux/sem.h

#define SEMMNI  128             /* <= IPCMNI  max # of semaphore identifiers */
#define SEMMSL  450             /* <= 8 000 max num of semaphores per id */
#define SEMMNS  1000            /* <= INT_MAX max # of semaphores in system */
#define SEMOPM  100             /* <= 1 000 max num of ops per semop call */
#define SEMVMX  32767           /* <= 32767 semaphore maximum value */
#define SEMAEM  SEMVMX          /* adjust on exit max value */

The only values I've changed are SEMMSL, and SEMMNS...

Looking at the semaphores, here's what I see...

root@tom:/usr/include/linux# cat /proc/sys/kernel/sem
250     32000   32      128
root@tom:/usr/include/linux#

How would I sysctl these values?...

I would prefer them to be statically built into the kernel...

I know that the kernel SHOULD be the right version, and I've done a make 
dep ; make clean ; make bzImage

My kernel version info...

root@tom:/usr/include/linux# cat /proc/sys/kernel/osrelease
2.4.19
root@tom:/usr/include/linux# cat /proc/sys/kernel/version
#4 SMP Tue Nov 19 16:21:21 PST 2002

Thanks muchly in advance!!!

Regards,
Richard.
---

Richard Whittaker,
System Manager,
NorthwesTel Inc.
Whitehorse, Yukon, Canada.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Semaphore and Shared memory questions...
  2002-11-20 22:04 ` Alan Cox
@ 2002-11-20 21:42   ` Richard Whittaker
  2002-11-20 22:16     ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Whittaker @ 2002-11-20 21:42 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List

At 10:04 PM 11/20/2002 +0000, Alan Cox wrote:

>The sysctl interface and sysctl setting tools on boot exist precisely so
>you dont have to hack these things around

Allright... This is fine by me... One of my questions was (and still is), 
what do I pass to sysctl for setting /proc/sys/kernel/sem?...

Setting shmmax was easy, since it's only a single hex value, but sem is 
puzzling me... Is a space separated list of values going to work?...

Thanks,
Richard.

---
Richard Whittaker,
System Manager,
NorthwesTel Inc.
Whitehorse, Yukon, Canada.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Semaphore and Shared memory questions...
  2002-11-20 21:30 Semaphore and Shared memory questions Richard Whittaker
@ 2002-11-20 22:04 ` Alan Cox
  2002-11-20 21:42   ` Richard Whittaker
       [not found] ` <sddb931a.041@nwtel.ca>
  1 sibling, 1 reply; 6+ messages in thread
From: Alan Cox @ 2002-11-20 22:04 UTC (permalink / raw)
  To: Richard Whittaker; +Cc: Linux Kernel Mailing List

On Wed, 2002-11-20 at 21:30, Richard Whittaker wrote:
> Part of building this machine up is tuning the kernel parameters for 
> shmmax, semmni, semmsl, semmns, etc...
> In reading, this should be fairly ieasy... Make some changes to 
> /usr/include/linux/sem.h and /usr/include/linux/shm.h, recompile, install, 
> LILO, reboot, and yer done... Well, my experience wasn't that simple...

Well if you insist on hacking code paths not using /proc Im not
suprised. You also probably ended up with a non oracle certified
platform by doing so (if that matters)

The sysctl interface and sysctl setting tools on boot exist precisely so
you dont have to hack these things around

Alan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Semaphore and Shared memory questions...
  2002-11-20 21:42   ` Richard Whittaker
@ 2002-11-20 22:16     ` Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2002-11-20 22:16 UTC (permalink / raw)
  To: Richard Whittaker; +Cc: Linux Kernel Mailing List

On Wed, 2002-11-20 at 21:42, Richard Whittaker wrote:
> At 10:04 PM 11/20/2002 +0000, Alan Cox wrote:
> 
> >The sysctl interface and sysctl setting tools on boot exist precisely so
> >you dont have to hack these things around
> 
> Allright... This is fine by me... One of my questions was (and still is), 
> what do I pass to sysctl for setting /proc/sys/kernel/sem?...
> 
> Setting shmmax was easy, since it's only a single hex value, but sem is 
> puzzling me... Is a space separated list of values going to work?...

Right first guess. Its mostly historical that it isnt 4 values.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Semaphore and Shared memory questions...
       [not found] ` <sddb931a.041@nwtel.ca>
@ 2002-11-20 22:17   ` Richard Whittaker
  2002-11-20 22:33     ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Whittaker @ 2002-11-20 22:17 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

At 02:16 PM 11/20/2002 -0800, Alan Cox wrote:
>On Wed, 2002-11-20 at 21:42, Richard Whittaker wrote:
> > At 10:04 PM 11/20/2002 +0000, Alan Cox wrote:
>
>Right first guess. Its mostly historical that it isnt 4 values.

What's the order of the values?...

I can take a wild stab that the first value is semmsl, or is it semmni, 
then the subsequent values?...

Are there plans to split them out into distinct values, or is that a 
massive rewrite?...

Thanks!
Richard.

---
Richard Whittaker,
System Manager,
NorthwesTel Inc.
Whitehorse, Yukon, Canada.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Semaphore and Shared memory questions...
  2002-11-20 22:17   ` Richard Whittaker
@ 2002-11-20 22:33     ` Randy.Dunlap
  0 siblings, 0 replies; 6+ messages in thread
From: Randy.Dunlap @ 2002-11-20 22:33 UTC (permalink / raw)
  To: Richard Whittaker; +Cc: Alan Cox, linux-kernel

On Wed, 20 Nov 2002, Richard Whittaker wrote:

| >Right first guess. Its mostly historical that it isnt 4 values.
|
| What's the order of the values?...
|
| I can take a wild stab that the first value is semmsl, or is it semmni,
| then the subsequent values?...
|
| Are there plans to split them out into distinct values, or is that a
| massive rewrite?...

I haven't seen a kernel version that you are working with,
but hopefully that won't matter.  This is from 2.4.19:

./ipc/sem.c:96:int sem_ctls[4] = {SEMMSL, SEMMNS, SEMOPM, SEMMNI};
./ipc/sem.c:97:#define sc_semmsl        (sem_ctls[0])
./ipc/sem.c:98:#define sc_semmns        (sem_ctls[1])
./ipc/sem.c:99:#define sc_semopm        (sem_ctls[2])
./ipc/sem.c:100:#define sc_semmni       (sem_ctls[3])

so that's the order.  If Alan replies, his matching reply can confirm
this.  :)

-- 
~Randy


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-20 22:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-20 21:30 Semaphore and Shared memory questions Richard Whittaker
2002-11-20 22:04 ` Alan Cox
2002-11-20 21:42   ` Richard Whittaker
2002-11-20 22:16     ` Alan Cox
     [not found] ` <sddb931a.041@nwtel.ca>
2002-11-20 22:17   ` Richard Whittaker
2002-11-20 22:33     ` Randy.Dunlap

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®