ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] Re: hasher vs SysV IPC
Date: Sat, 6 Sep 2003 11:21:34 +0400
Message-ID: <20030906072133.GA16772@basalt.office.altlinux.org> (raw)
In-Reply-To: <20030906091313.I77596@elefant.dgtu.donetsk.ua>

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2003-09-06  7:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-24 17:43 [devel] " Alexey Tourbin
2003-08-24 22:14 ` Dmitry Lebkov
2003-08-25  8:49   ` [devel] " Alexey Tourbin
2003-08-24 10:58     ` Dmitry Lebkov
2003-08-26  5:01       ` Grigory Batalov
2003-08-25  8:56     ` Alexey Tourbin
2003-08-27 12:42     ` Michael Shigorin
2003-08-27 12:47       ` Dmitry V. Levin
2003-09-03 14:19       ` Alexey Tourbin
2003-09-03 14:29         ` Michael Shigorin
2003-09-04 10:12           ` Alexey Tourbin
2003-09-05 20:18         ` Dmitry V. Levin
2003-09-06  5:50           ` Dmitry Lebkov
2003-09-07  9:00             ` Dmitry V. Levin
2003-09-12  8:05               ` Sergey Vlasov
2003-09-12  8:19                 ` Dmitry V. Levin
2003-09-06  6:49           ` Denis Ovsienko
2003-09-06  7:21             ` Dmitry V. Levin [this message]
2003-09-06  7:36               ` Mikhail Zabaluev
2003-09-06  9:04                 ` Dmitry V. Levin
2003-09-06 10:50               ` Denis Ovsienko
2003-09-06 20:37                 ` Dmitry V. Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030906072133.GA16772@basalt.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git