From: Cyril Hrubis <chrubis@suse.cz>
To: Jiri Jaburek <jjaburek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v2] containers: added mountns/mountns05.c
Date: Mon, 5 Jan 2015 13:38:24 +0100 [thread overview]
Message-ID: <20150105123823.GA30102@rei.suse.de> (raw)
In-Reply-To: <5495D100.8000107@redhat.com>
Hi!
> May I ask why there needs to be a distinction between "parent" and
> "child" embedded into the checkpoint implementation, going as far as
> checking 'p' or 'c' read from FIFO? Why does it matter?
> I guess it adds a little to "code safety", but also severely limits
> the use cases for checkpointing. Why not simply have a "regular" mutex
> lock, like ie. pthread mutexes?
The distinction is unfortunately mandated by the differencies between
the parent (main test process) and child (forked process).
The parent is expected to prepare the testing environment and also do a
cleanup and therefore uses the tst_* interface, passes the cleanup
function pointer to the calls etc. The parent also includes timeout
logic which ensures that the parent does not hang while waiting for
children to come up.
The child processes does only the some test related task and does not
use the tst_ interface, exit with plain exit(), etc. The letter that is
send around is different in order to enforce that the right function is
called, no more no less. What this avoids, for example, is calling
cleanup callback from the child process that is common mistake which
leads to ugly race conditions.
Note also that before commit 8c1e0b3afe4f1c4da32fe7d1b5fa9738aacacab4
any usage of tst_* interface in child processes was strongly
discouraged.
Maybe we can rethink the API a bit now...
> Going a bit further - wouldn't it be easier to simply let the test(s)
> use sysv ipc, with tstlib-created objects (IPC_PRIVATE), providing
> semi-safe macros for svipc(7) functions (permitting ie. EAGAIN)?
>
> (or even use sysv ipc for the mutex implementation, think semtimedop(2)
> instead of open_wronly_timed)
I've considered that.
There are a few downsides to this approach. Apart from these being
global system resources the reason why I've choosen fifos over these is
that they can be compiled out of kernel and there are minimal systems
out there run fine without them. And while I do not care much that
sysvipc tests are broken on such configuration I certainly do not want
to break rest of the testcases.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-01-05 12:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 15:07 [LTP] [PATCH] containers: added mountns/mountns05.c Matus Marhefka
2014-10-30 16:01 ` Cyril Hrubis
2014-11-05 16:49 ` [LTP] [PATCH v2] " Matus Marhefka
2014-12-02 16:42 ` Cyril Hrubis
[not found] ` <1962544618.7994595.1417604885928.JavaMail.zimbra@redhat.com>
2014-12-17 14:10 ` Cyril Hrubis
[not found] ` <5495D100.8000107@redhat.com>
2015-01-05 12:38 ` Cyril Hrubis [this message]
[not found] ` <939621071.8375320.1423670135099.JavaMail.zimbra@redhat.com>
2015-02-12 15:04 ` Cyril Hrubis
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=20150105123823.GA30102@rei.suse.de \
--to=chrubis@suse.cz \
--cc=jjaburek@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox