From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 6 Sep 2003 11:21:34 +0400 From: "Dmitry V. Levin" To: ALT Devel discussion list Subject: Re: [devel] Re: hasher vs SysV IPC Message-ID: <20030906072133.GA16772@basalt.office.altlinux.org> Mail-Followup-To: ALT Devel discussion list References: <20030824174356.GA9374@julia.office.altlinux.ru> <20030825091400.1d3de106.dima@sakhalin.ru> <20030825084957.GD1872@julia.office.altlinux.ru> <20030827124204.GP12801@osdn.org.ua> <20030903141941.GJ28997@julia.office.altlinux.ru> <20030905201823.GA14631@basalt.office.altlinux.org> <20030906091313.I77596@elefant.dgtu.donetsk.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline In-Reply-To: <20030906091313.I77596@elefant.dgtu.donetsk.ua> X-fingerprint: 9658 398D 181B 1200 8FC5 26B8 F6F8 846B C1E2 3429 X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.2 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2003 07:21:34 -0000 Archived-At: List-Archive: List-Post: --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit On Sat, Sep 06, 2003 at 09:49:36AM +0300, Denis Ovsienko wrote: > > Если ядро не очищает SYSV IPC за процессами (как в -ow), то и ограничение > > в 2048 может быть достигнуто. > > > > Выходов два: > > 1. Использовать ядра с включённой очисткой SYSV IPC. > > 2. Продублировать код из ipcs/ipcrm в hasher'е (точнее говоря, в > > hasher-priv killuid{1,2}). > > > > Какие будут предложения? > Господа, я читаю вашу газету и худею. Если бы вы программировали под IPC > хотя бы некоторое время, то знали бы, что ресурсы по умолчанию не > удаляются, когда счётчик процессов, их использующих, достигает нуля (то > есть количество вызовов shmdt равняется количеству вызовов shmat). Чтобы > удалялись, выставляется флаг с помощью shmctl (shmid, IPC_RMID, buf). Для > семафоров аналогично. То, о чём вы говорите, порой не соответствует действительности, хотя об этом и написано в старых книжках. Например, в ow-ядрах есть параметр: Destroy shared memory segments not in use CONFIG_HARDEN_SHM Linux lets you set resource limits, including on how much memory one process can consume, via setrlimit(2). Unfortunately, shared memory segments are allowed to exist without association with any process, and thus might not be counted against any resource limits. This option automatically destroys shared memory segments when their attach count becomes zero after a detach or a process termination. It will also destroy segments that were created, but never attached to, on exit from the process. (In case you're curious, the only use left for IPC_RMID is to immediately destroy an unattached segment.) Of course, this breaks the way things are defined, so some applications might stop working. Note that this feature will do you no good unless you also configure your resource limits (in particular, RLIMIT_AS and RLIMIT_NPROC). Вообще говоря, portable software не должно полагаться на то или иное поведение ядра в этой ситуации. -- ldv --ew6BAiZeqk4r7MaW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/WYr99viEa8HiNCkRAjC+AJ9gsMWz/lhitNGljchEHxQBP64+GwCdHHpG vms8w0Ck4MsoZYonlmd3Lek= =tLoi -----END PGP SIGNATURE----- --ew6BAiZeqk4r7MaW--