From: Cyril Hrubis <chrubis@suse.cz>
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] kmsg01: avoid infinite run in test_read_block()
Date: Mon, 22 Jun 2015 17:14:17 +0200 [thread overview]
Message-ID: <20150622151416.GA9223@rei.suse.de> (raw)
In-Reply-To: <676745151.5941810.1434981383477.JavaMail.zimbra@redhat.com>
Hi!
> > Apart from that the logic looks fine. The test could be probably cleaned
> > by using checkpoints instead of pipe and the function used to propagate
> > exit value from child, but that is probably worth of separate patch.
>
> Checkpoint alone doesn't seem to be enough to tell difference between:
> - child has read one record and will continue reading
> - child read has reached eof and will now exit
>
> while parent does:
> do {
> ret = tst_checkpoint_wait()
> } while (ret == 0)
>
> I could map some shared memory for such flag, but I'm thinking if I can't just
> use tst_futexes to store such flag. In that case, it would likely be
> needed to handle EWOULDBLOCK in tst_checkpoint_wait and restart wait.
Hmm, we can change the tst_checkpoint library to allocate two uint32_t
per id (even would be for futex and odd for the propagated value) and
add parameters to propagate 32bit integer value from
tst_checkpoint_wake() to tst_checkpoint_wait(). That way we would avoid
the need for changing the futex related code at all (the only change
would be id -> 2 * id). Given that we allocate whole page we can waste
half of the checkpoint pairs without any problems.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2015-06-22 15:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 14:47 [LTP] [PATCH] kmsg01: avoid infinite run in test_read_block() Jan Stancek
2015-06-22 12:20 ` Cyril Hrubis
[not found] ` <676745151.5941810.1434981383477.JavaMail.zimbra@redhat.com>
2015-06-22 13:58 ` Cyril Hrubis
[not found] ` <1603834412.5959211.1434983075966.JavaMail.zimbra@redhat.com>
2015-06-22 15:01 ` Cyril Hrubis
2015-06-22 15:14 ` Cyril Hrubis [this message]
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=20150622151416.GA9223@rei.suse.de \
--to=chrubis@suse.cz \
--cc=jstancek@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