Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 May 2013 01:49:37 +0400
From:      Vagner <vagner@bsdway.ru>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: SystemV IPC. Segment info
Message-ID:  <20130430214937.GA27234@vagner-wrk.bsdway.ru>
In-Reply-To: <20130430144411.GA1002@stack.nl>
References:  <mailman.7.1366113601.5692.freebsd-hackers@freebsd.org> <20130430034940.GA8305@vagner-wrk.bsdway.ru> <20130430144411.GA1002@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16:44 Tue 30 Apr , Jilles Tjoelker wrote:
> On Tue, Apr 30, 2013 at 07:49:40AM +0400, Vagner wrote:
> > Tell me please, may I send this to PR, or this changes is not valid?
> 
> > > A few weeks ago, I ran into problem, which related to SystemV IPC.
> > > More than 20 processes attached to a segment shared queue.
> > > Process-initiator for create segment was killed, as process which
> > > was accessed to segment last. Segment didn't free memory, but tagged
> > > it as SHMSEG_REMOVED as the result. This is a reason of memory
> > > overflow (memory assotiated as shm). Moreover, processes, which was
> > > attached to this segment did't get a new data. I have one resolve. I
> > > need to restarted all process, which still attached to segment. But
> > > this reason have a problem. We haven't list of this processes at
> > > system. Moreover, struct shmid_ds, which described segment, haven't
> > > this info too.
> 
> > > This patch is a resolve of problem. It: 
> > > - added a linked list of structures shmid_pi in struct shmid_ds. PID
> > > (and last access time) recorded to this struct consistently. Memory
> > > allocates with ident 'shminfo' for this list of struct shmid_pi.
> > > - added syscall shminf for get all elements from list shmid_ds.
> > > - added option [-P] in ipcs(1) for system call shminf.
> 
> I think it is strange to maintain pids in the VM system. This makes the
> VM system more complex for little reason (because the information is
> only needed for monitoring, not normal operation).
> 

Yes, it, may be, not nice solution, but I don't found there I can see address
of segment (from user space). If you know where can see, tell me please.

> Perhaps it is possible to do what you want using procstat -v or a slight
> extension to it.
> 

procstat(1) can show for me only proc->ki_vmspace struct, but there not
contain info about mapping shared serments.

> Alternatively, you may find a different way to get rid of your stale
> worker processes. For example, before invoking shmctl(IPC_RMID), set a
> flag inside the memory segment that all workers should exit and activate
> whatever mechanism you use for telling the workers that they need to do
> something.

This solution requires action from workers, but I think many developers
will not want to rewrite their soft...

> 
> -- 
> Jilles Tjoelker
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


of segment (from user space). If you know where can see, tell me please.
\

-- 
Respectfully,
Stanislav Putrya
System administrator
FotoStrana.Ru Ltd.
ICQ IM: 328585847
Jabber-GoogleTalk: root.vagner
mob.phone SPB: +79215788755
mob.phone RND: +79525600664
email: vagner@bsdway.ru
email: putrya@playform.ru
email: root.vagner@gmail.com
site: bsdway.ru
site: fotostrana.ru

----------------------------------------
 ( ) ASCII ribbon campaign
  X  - against HTML, vCards and
 / \ - proprietary attachments in e-mail



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130430214937.GA27234>