Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491621 > unrolled thread

[PATCH] perf: sched-pipe add support for packet I/O mode

Started byShuah Khan <shuahkh@osg.samsung.com>
First post2016-09-27 02:40 +0200
Last post2016-09-27 13:40 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf: sched-pipe add support for packet I/O mode Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-27 02:40 +0200
    Re: [PATCH] perf: sched-pipe add support for packet I/O mode Peter Zijlstra <peterz@infradead.org> - 2016-09-27 13:40 +0200
      Re: [PATCH] perf: sched-pipe add support for packet I/O mode Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-27 18:40 +0200
    Re: [PATCH] perf: sched-pipe add support for packet I/O mode Peter Zijlstra <peterz@infradead.org> - 2016-09-27 13:40 +0200

#1491621 — [PATCH] perf: sched-pipe add support for packet I/O mode

FromShuah Khan <shuahkh@osg.samsung.com>
Date2016-09-27 02:40 +0200
Subject[PATCH] perf: sched-pipe add support for packet I/O mode
Message-ID<slOBb-2pK-7@gated-at.bofh.it>
Add support to run sched-pipe benchmark test on pipe with packet I/O mode.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/perf/bench/sched-pipe.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
index 1dc2d13..c6e1b7a 100644
--- a/tools/perf/bench/sched-pipe.c
+++ b/tools/perf/bench/sched-pipe.c
@@ -41,9 +41,16 @@ static	int			loops = LOOPS_DEFAULT;
 /* Use processes by default: */
 static bool			threaded;
 
+/* Use non-packet (normal) I/O mode by default.
+ * In packet mode, each write is a separate packet.
+ */
+static bool			packet_mode;
+
 static const struct option options[] = {
 	OPT_INTEGER('l', "loop",	&loops,		"Specify number of loops"),
 	OPT_BOOLEAN('T', "threaded",	&threaded,	"Specify threads/process based task setup"),
+	OPT_BOOLEAN('P', "packet mode",	&packet_mode,
+		    "Specify packet I/O mode - "),
 	OPT_END()
 };
 
@@ -83,6 +90,7 @@ int bench_sched_pipe(int argc, const char **argv, const char *prefix __maybe_unu
 	unsigned long long result_usec = 0;
 	int nr_threads = 2;
 	int t;
+	int flags = 0;
 
 	/*
 	 * why does "ret" exist?
@@ -94,6 +102,18 @@ int bench_sched_pipe(int argc, const char **argv, const char *prefix __maybe_unu
 
 	argc = parse_options(argc, argv, options, bench_sched_pipe_usage, 0);
 
+	if (packet_mode) {
+		/* BUG_ON doesn't make sense exit if pipe2() fails */
+		flags = O_DIRECT;
+		ret = pipe2(pipe_1, flags);
+		if (ret)
+			exit(1);
+		ret = pipe2(pipe_2, flags);
+		if (ret)
+			exit(1);
+		printf("Running sched-pipe in packet I/O mode\n\n");
+	}
+
 	BUG_ON(pipe(pipe_1));
 	BUG_ON(pipe(pipe_2));
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1491831

FromPeter Zijlstra <peterz@infradead.org>
Date2016-09-27 13:40 +0200
Message-ID<slYTT-wK-1@gated-at.bofh.it>
In reply to#1491621
On Mon, Sep 26, 2016 at 06:29:44PM -0600, Shuah Khan wrote:
> Add support to run sched-pipe benchmark test on pipe with packet I/O mode.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  tools/perf/bench/sched-pipe.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
> index 1dc2d13..c6e1b7a 100644
> --- a/tools/perf/bench/sched-pipe.c
> +++ b/tools/perf/bench/sched-pipe.c
> @@ -41,9 +41,16 @@ static	int			loops = LOOPS_DEFAULT;
>  /* Use processes by default: */
>  static bool			threaded;
>  
> +/* Use non-packet (normal) I/O mode by default.
> + * In packet mode, each write is a separate packet.
> + */

Also,

https://lkml.kernel.org/r/CA+55aFyQYJerovMsSoSKS7PessZBr4vNp-3QUUwhqk4A4_jcbg@mail.gmail.com

[toc] | [prev] | [next] | [standalone]


#1492020

FromShuah Khan <shuahkh@osg.samsung.com>
Date2016-09-27 18:40 +0200
Message-ID<sm3Ad-3oW-21@gated-at.bofh.it>
In reply to#1491831
On 09/27/2016 05:38 AM, Peter Zijlstra wrote:
> On Mon, Sep 26, 2016 at 06:29:44PM -0600, Shuah Khan wrote:
>> Add support to run sched-pipe benchmark test on pipe with packet I/O mode.

I will add more detail here.

>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> ---
>>  tools/perf/bench/sched-pipe.c | 20 ++++++++++++++++++++
>>  1 file changed, 20 insertions(+)
>>
>> diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
>> index 1dc2d13..c6e1b7a 100644
>> --- a/tools/perf/bench/sched-pipe.c
>> +++ b/tools/perf/bench/sched-pipe.c
>> @@ -41,9 +41,16 @@ static	int			loops = LOOPS_DEFAULT;
>>  /* Use processes by default: */
>>  static bool			threaded;
>>  
>> +/* Use non-packet (normal) I/O mode by default.
>> + * In packet mode, each write is a separate packet.
>> + */
> 
> Also,
> 
> https://lkml.kernel.org/r/CA+55aFyQYJerovMsSoSKS7PessZBr4vNp-3QUUwhqk4A4_jcbg@mail.gmail.com
> 

Bummer. I missed this comment style bad on my part. I will address both
and send v2.

thanks,
-- Shuah

[toc] | [prev] | [next] | [standalone]


#1491832

FromPeter Zijlstra <peterz@infradead.org>
Date2016-09-27 13:40 +0200
Message-ID<slYTU-wK-39@gated-at.bofh.it>
In reply to#1491621
On Mon, Sep 26, 2016 at 06:29:44PM -0600, Shuah Khan wrote:
> Add support to run sched-pipe benchmark test on pipe with packet I/O mode.

Fails to explain what packet mode is and why we would want this.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web