From: chrubis@suse.cz
To: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH V2 2/2] msgctl11: process message queues by portions
Date: Tue, 25 Feb 2014 13:25:39 +0100 [thread overview]
Message-ID: <20140225122538.GA12159@rei.Home> (raw)
In-Reply-To: <530C5E99.6050809@oracle.com>
Hi!
> >> - if ((MSGMNI * MAXNKIDS * 2) > (free_pids / 2)) {
> >> - maxnkids = ((free_pids / 4) / MSGMNI);
> >> - if (!maxnkids)
> >> - tst_brkm(TBROK, cleanup, "Not enough free pids");
> >> - }
> >
> > Removing this part of the code makes the test run more than ten times
> > longer because now the maximal number of reader/writer pairs is set to
> > default value (10) and not to 1 which is what the code did previously. I
> > guess that this was intentional but it took me some time to figure that
> > out.
>
> Hmmm. Could you elaborate on that? About '1' value.
>
> For example, given that:
> free_pids = 32333
> MSGMNI = 4000
> MAXNKIDS = 10
> maxnkids will evaluate to 2. But if MSGMNI is 9000, the initial version
> of msgctl11 will fail with "Not enough free pids".
>
> In some situations this expression:
> (MSGMNI * MAXNKIDS * 2) > (free_pids / 2)
> may evaluate to false, and maxnkids will be MAXNKIDS (10).
>
> So the original version may execute faster under __some__ circumstances
> where the maxnkids value is evaluated to be < 10.
On my systems /proc/sys/kernel/pid_max is set to 32768 and MSGMNI is
from 2000 to 7000 on most of the machines I've seen. So the value of
maxnkids was between 1 and 4 previously but it defaults to 10 after this
patch which increases the test runtime by minute or two.
Thinking of this again the most behavior preserving change would be:
if ((MSGMNI * MAXNKIDS * 2) > (free_pids / 2))
maxnkids = MAX(1, ((free_pids / 4) / MSGMNI));
Which would scale the number of kids to the free pids but will not abort
the test if there is not enough free pids. The drawback is that the code
is complicated enough even without this change...
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-02-25 12:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 13:39 [LTP] [PATCH] msgctl11: process message queues by portions Stanislav Kholmanskikh
2014-02-06 13:29 ` chrubis
[not found] ` <52F9EE70.9040700@oracle.com>
2014-02-11 14:23 ` chrubis
2014-02-11 15:19 ` [LTP] [PATCH V2 1/2] msgctl11: cleanup and fflush removed Stanislav Kholmanskikh
2014-02-11 15:19 ` [LTP] [PATCH V2 2/2] msgctl11: process message queues by portions Stanislav Kholmanskikh
2014-02-21 18:11 ` chrubis
[not found] ` <530C5E99.6050809@oracle.com>
2014-02-25 12:25 ` chrubis [this message]
[not found] ` <530CA0A3.403@oracle.com>
2014-02-25 14:00 ` chrubis
2014-02-25 14:40 ` [LTP] [PATCH V3 1/2] msgctl11: cleanup and fflush removed Stanislav Kholmanskikh
2014-02-25 14:40 ` [LTP] [PATCH V3 2/2] msgctl11: process message queues by portions Stanislav Kholmanskikh
2014-03-05 10:45 ` chrubis
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=20140225122538.GA12159@rei.Home \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=stanislav.kholmanskikh@oracle.com \
--cc=vasily.isaenko@oracle.com \
/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