|
osdir.com mailing list archive F.A.Q. -since 2001! |
|
|
|
Subject: Re: Semaphore limits!! - msg#00215List: linux.kernel.kernelnewbies
by Date: Prev Next Date Index by Thread: Prev Next Thread Index
Suman Wrote: > > Yes, you can. And you have answered the how part of it urself - By modifying > > the /proc/sys/kernel/sem to the appropriate numbers. > >> > This is how I do it: > >> > "echo 32 65792 32 2056 > /proc/sys/kernel/sem" Quickly setting values like this in /proc/sys is helpful during testing. However these special settings are lost when the machine is rebooted. To preserve the settings and to make permanently to your kernel, add them to the /etc/sysctl.conf file. $man sysctl JS "Software is like sex, better when it is free" - Linus Torvalds -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
Thread at a glance:
Previous Message by Date:lvcreate -- ERROR "Cannot allocate memory" creating VGDAHi All, I am trying the following "lvcreate" command and I am hit an error. I googled for this error, and I can see it being listed in lotz of places, but without any solution or workaround. Configuration: ---------------------- RH-Linux 2.4.26 1GB memory. But the same command works fine, if I have only 512 MB RAM. Any help is highly appreciated. Thanks Shesha --------------- [root@mc26300a root]# lvcreate -s -l 4306 -n stest /dev/VG_H41/LV_H41 lvcreate -- WARNING: the snapshot will be automatically disabled once it gets full lvcreate -- INFO: using default snapshot chunk size of 64 KB for "/dev/VG_H41/ste1" lvcreate -- ERROR "Cannot allocate memory" creating VGDA for "/dev/VG_H41/ste1" in kernel ---------------- -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/ Next Message by Date:problem in initilisationHI, I wrote one character device which should create network device. When I do insmod it gave a segmentation fault and lsmod shows initializing. A dmesg shows: EIP is at init_module [testdriver] 0xa6 (2.4.18-14) eax: 00000000 ebx: ffffffea ecx: c05b6000 edx: c8e7f4d3 esi: 00000000 edi: 00000000 ebp: c672df18 esp: c672df00 ds: 0018 es: 0018 ss: 0018 Process insmod (pid: 9922, stackpage=c672d000) Stack: 00200206 ffffffff 00002f3f c05b6940 00000000 00000000 c8e7f000 c011bf79 c8e7f060 08075228 00000908 00000000 080756f4 0000052c 00000060 00000060 0000000a c05b6c40 c6231000 c6e7e000 00000060 c8def000 c8e7f060 00000968 Call Trace: [<c011bf79>] sys_init_module [kernel] 0x4d9 (0xc672df1c)) [<c8e7f060>] test_open [testdriver] 0x0 (0xc672df20)) [<c8e7f060>] test_open [testdriver] 0x0 (0xc672df58)) [<c010910f>] system_call [kernel] 0x33 (0xc672dfc0)) Code: c7 40 34 fe f0 e7 c8 83 ec 08 68 d4 f4 e7 c8 8b 45 f4 ff 30 I am attaching the code, pls help me to solve this problem. Thanks a lot, -Ravi #ifndef __KERNEL__ # define __KERNEL__ #endif #ifndef MODULE # define MODULE #endif #define DEVNAME "testdev" #include <linux/module.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/slab.h> #include <linux/netdevice.h> #include <linux/if_ether.h> int test_open(struct inode *,struct file *); int test_release(struct inode *,struct file*); struct test_struct{ struct net_device *dev; char name[IFNAMSIZ]; }; struct file_operations test_fop={ llseek: NULL, read: NULL, write: NULL, ioctl: NULL, open: test_open, release: test_release, }; int test_open(struct inode *inode, struct file *filep) { MOD_INC_USE_COUNT; return 0; } int test_release(struct inode *inode, struct file *filep) { MOD_DEC_USE_COUNT; return 0; } int testdev_open(struct net_device *dev) { MOD_INC_USE_COUNT; return 0; } int testdev_close(struct net_device *dev) { unregister_netdev(dev); MOD_DEC_USE_COUNT; return 0; } static int test_init_dev(struct net_device *dev) { struct test_struct *c; dev->priv = kmalloc(sizeof(struct net_device),GFP_KERNEL); if(!dev->priv) { printk(KERN_ERR "out of memory while allocating to dev->priv\n"); return -ENOMEM; } c = (struct test_struct *)dev->priv; if(!c) return -ENODEV; memset(c,0,sizeof(struct test_struct)); c->dev = dev; ether_setup(dev); dev->open = testdev_open; dev->stop = testdev_close; dev->mtu = ETH_DATA_LEN; dev_init_buffers(dev); return 0; } int init_module(void) { int result,i; struct test_struct *pTestStruct; result = register_chrdev(16,"test",&test_fop); if( result < 0 ){ printk(KERN_WARNING "test: cant get major\n"); return result; } pTestStruct = (struct test_struct *)kmalloc(sizeof( struct test_struct),GFP_KERNEL); if(!pTestStruct) { printk(KERN_ERR "failed to allocate memory\n"); return -ENOMEM; } memset((void *)pTestStruct,0,sizeof(pTestStruct)); sprintf(pTestStruct->name, DEVNAME); //pTestStruct->dev->priv = pTestStruct; pTestStruct->dev->init = test_init_dev; i = dev_alloc_name(pTestStruct->dev,"testdev%d"); if(i < 0 ) { printk(KERN_ERR "cant allocate device\n"); return -ENODEV; } i = register_netdevice((pTestStruct->dev)); if( i < 0 ) printk(KERN_ERR "register netdevice failed\n"); return 0; } void cleanup_module(void) { unregister_chrdev(16,"test"); } Previous Message by Thread:Re: Semaphore limits!!thanx Suman, surely its a great help. -praveen. ----- Original Message ----- From: "Suman Puthana" <suman@xxxxxxxxxxxxx> To: "Praveen Nair" <praveen.nair@xxxxxxxxx>; <kernelnewbies@xxxxxxxxxxxx> Sent: Sunday, April 18, 2004 6:43 PM Subject: Re: Semaphore limits!! > Praveen, > > Yes, you can. And you have answered the how part of it urself - By modifying > the /proc/sys/kernel/sem to the appropriate numbers. > > This is how I do it: > > "echo 32 65792 32 2056 > /proc/sys/kernel/sem" and it has been working > pretty well for me. > > Suman Puthana, > > Member of Technical Staff, > BroadWare Technologies. > > ----- Original Message ----- > From: "Praveen Nair" <praveen.nair@xxxxxxxxx> > To: <kernelnewbies@xxxxxxxxxxxx> > Sent: Friday, April 16, 2004 11:36 PM > Subject: Semaphore limits!! > > > > Hi, > > ipcs -l tells me that the limit for number of semaphore arrays is 128 > > where each array can grow upto 250 semaphores...now my question > > is, can i have more than 128 semaphore arrays if i can live with lesser > > number of semaphores per array, the limit for system wide semaphore > > not exceeding?? > > another doubt is can i modify the /proc/sys/kernel/sem file for the > same?? > > > > any help is valuable :) > > > > Thanks in advance.. > > > > -praveen. > > > > > > > > -- > > Kernelnewbies: Help each other learn about the Linux kernel. > > Archive: http://mail.nl.linux.org/kernelnewbies/ > > FAQ: http://kernelnewbies.org/faq/ > > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/ Next Message by Thread:Re: Semaphore limits!!thanx suresh, but another doubt that lingers in my mind is can i exceed the 32000 limits and keep within 32767?? since semaphore ids can range from 0 to 32767... -praveen. ----- Original Message ----- From: "Suresh Jayaram" <sureshj@xxxxxxxxxxxxxx> To: "kernelnewbies" <kernelnewbies@xxxxxxxxxxxx> Cc: "Praveen Nair" <praveen.nair@xxxxxxxxx> Sent: Monday, April 19, 2004 10:30 AM Subject: Re: Semaphore limits!! > > Suman Wrote: > > > > Yes, you can. And you have answered the how part of it urself - By > modifying > > > the /proc/sys/kernel/sem to the appropriate numbers. > > >> > This is how I do it: > > >> > "echo 32 65792 32 2056 > /proc/sys/kernel/sem" > > Quickly setting values like this in /proc/sys is helpful during testing. > However these special settings are lost when the machine is rebooted. > To preserve the settings and to make permanently to your kernel, add them to > the /etc/sysctl.conf file. > > $man sysctl > > JS > > "Software is like sex, better when it is free" > - Linus Torvalds > > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
blog comments powered by Disqus
|
|