linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Ingo Molnar	 <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton	 <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Mel Gorman <mgorman@suse.de>, Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2 0/4] sched: Move task_mm_cid_work to mm delayed work
Date: Fri, 13 Dec 2024 12:31:35 +0100	[thread overview]
Message-ID: <7cf8c25f325d433c2abc473f3d877067e216ff6c.camel@redhat.com> (raw)
In-Reply-To: <20241213095407.271357-1-gmonaco@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 12214 bytes --]

On Fri, 2024-12-13 at 10:54 +0100, Gabriele Monaco wrote:
> OVERHEAD COMPARISON
>
> [..]
>
> I will post another email with the scripts used to retrieve the data
> and
> more details about the runtime distribution.

This message contains the performance results produced by my scripts, which are attached.
The tracing is done via bpftrace while a simple bash script is spawning and killing the loads.

From the histograms it's easier to see the distribution of the durations and if there are clear outliers.

TEST RESULTS ON HEAD

Running without loads on virtme-ng

@duration_max: 426
@duration_total: count 13, average 75, total 987

@durations:
[25, 30)               1 |@@@@@@@@@@@@@@@@@                                   |
[30, 35)               2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                  |
[35, 40)               2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                  |
[40, 45)               0 |                                                    |
[45, 50)               3 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[50, 55)               2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                  |
[55, 60)               0 |                                                    |
[60, 65)               1 |@@@@@@@@@@@@@@@@@                                   |
[65, 70)               0 |                                                    |
[70, 75)               0 |                                                    |
[75, 80)               0 |                                                    |
[80, 85)               0 |                                                    |
[85, 90)               0 |                                                    |
[90, 95)               1 |@@@@@@@@@@@@@@@@@                                   |
[95, 100)              0 |                                                    |
[100, ...)             1 |@@@@@@@@@@@@@@@@@                                   |

@processes: 12
@threads: 12

Running with cpu loads on virtme-ng

@duration_max: 2508
@duration_total: count 35948, average 20, total 742603

@durations:
[10, 15)            1889 |@@@@@                                               |
[15, 20)           17278 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[20, 25)           10742 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                    |
[25, 30)            3327 |@@@@@@@@@@                                          |
[30, 35)            2350 |@@@@@@@                                             |
[35, 40)             326 |                                                    |
[40, 45)               5 |                                                    |
[45, 50)               1 |                                                    |
[50, 55)               2 |                                                    |
[55, 60)               1 |                                                    |
[60, 65)               2 |                                                    |
[65, 70)               2 |                                                    |
[70, 75)               0 |                                                    |
[75, 80)               0 |                                                    |
[80, 85)               1 |                                                    |
[85, 90)               0 |                                                    |
[90, 95)               1 |                                                    |
[95, 100)              1 |                                                    |
[100, ...)            20 |                                                    |

@processes: 129
@threads: 129

Running with fork loads on virtme-ng

@duration_max: 41
@duration_total: count 21, average 34, total 720

@durations:
[30, 35)              12 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[35, 40)               8 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                  |
[40, 45)               1 |@@@@                                                |

@processes: 3592
@threads: 3592

Running with thread loads on virtme-ng

@duration_max: 195
@duration_total: count 1286, average 31, total 41082

@durations:
(..., 10)            326 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@        |
[10, 15)              10 |@                                                   |
[15, 20)               0 |                                                    |
[20, 25)               1 |                                                    |
[25, 30)              61 |@@@@@@@@                                            |
[30, 35)             377 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[35, 40)             264 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                |
[40, 45)              65 |@@@@@@@@                                            |
[45, 50)              32 |@@@@                                                |
[50, 55)              12 |@                                                   |
[55, 60)              13 |@                                                   |
[60, 65)               7 |                                                    |
[65, 70)              10 |@                                                   |
[70, 75)              10 |@                                                   |
[75, 80)              33 |@@@@                                                |
[80, 85)              26 |@@@                                                 |
[85, 90)              13 |@                                                   |
[90, 95)               6 |                                                    |
[95, 100)              2 |                                                    |
[100, ...)            18 |@@                                                  |

@processes: 129
@threads: 4096

TEST RESULTS ON PATCH

Running without loads on virtme-ng

@duration_max: 42
@duration_total: count 20601, average 2, total 45496

@durations:
(..., 10)          20304 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[10, 15)               1 |                                                    |
[15, 20)               4 |                                                    |
[20, 25)              29 |                                                    |
[25, 30)              33 |                                                    |
[30, 35)              11 |                                                    |
[35, 40)             156 |                                                    |
[40, 45)              63 |                                                    |

@processes: 12
@threads: 12

Running with cpu loads on virtme-ng

@duration_max: 774
@duration_total: count 38612, average 7, total 281558

@durations:
(..., 10)          34607 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[10, 15)            2558 |@@@                                                 |
[15, 20)             735 |@                                                   |
[20, 25)             454 |                                                    |
[25, 30)             225 |                                                    |
[30, 35)              17 |                                                    |
[35, 40)               8 |                                                    |
[40, 45)               2 |                                                    |
[45, 50)               4 |                                                    |
[50, 55)               0 |                                                    |
[55, 60)               0 |                                                    |
[60, 65)               0 |                                                    |
[65, 70)               0 |                                                    |
[70, 75)               0 |                                                    |
[75, 80)               0 |                                                    |
[80, 85)               0 |                                                    |
[85, 90)               0 |                                                    |
[90, 95)               0 |                                                    |
[95, 100)              0 |                                                    |
[100, ...)             2 |                                                    |

@processes: 129
@threads: 129

Running with fork loads on virtme-ng

@duration_max: 457
@duration_total: count 45683, average 19, total 878511

@durations:
(..., 10)           8452 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                  |
[10, 15)            7287 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                       |
[15, 20)           12727 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[20, 25)            2942 |@@@@@@@@@@@@                                        |
[25, 30)            2975 |@@@@@@@@@@@@                                        |
[30, 35)            7305 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                       |
[35, 40)            2994 |@@@@@@@@@@@@                                        |
[40, 45)             676 |@@                                                  |
[45, 50)             180 |                                                    |
[50, 55)              57 |                                                    |
[55, 60)              19 |                                                    |
[60, 65)               6 |                                                    |
[65, 70)               4 |                                                    |
[70, 75)               2 |                                                    |
[75, 80)               5 |                                                    |
[80, 85)               6 |                                                    |
[85, 90)               4 |                                                    |
[90, 95)               5 |                                                    |
[95, 100)              2 |                                                    |
[100, ...)            34 |                                                    |

@processes: 3982
@threads: 3982

Running with thread loads on virtme-ng

@duration_max: 1046
@duration_total: count 38643, average 21, total 833034

@durations:
(..., 10)           1631 |@@@@@                                               |
[10, 15)           11027 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@              |
[15, 20)           14832 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[20, 25)            1338 |@@@@                                                |
[25, 30)            1112 |@@@                                                 |
[30, 35)            3781 |@@@@@@@@@@@@@                                       |
[35, 40)            1994 |@@@@@@                                              |
[40, 45)             464 |@                                                   |
[45, 50)             262 |                                                    |
[50, 55)             200 |                                                    |
[55, 60)             294 |@                                                   |
[60, 65)             620 |@@                                                  |
[65, 70)             256 |                                                    |
[70, 75)             119 |                                                    |
[75, 80)             232 |                                                    |
[80, 85)             220 |                                                    |
[85, 90)              55 |                                                    |
[90, 95)              30 |                                                    |
[95, 100)             19 |                                                    |
[100, ...)           157 |                                                    |

@processes: 129
@threads: 4096


-- 
  Gabriele Monaco 
 Senior Software Engineer - Kernel Real Time 
 
Red Hat 
  gmonaco@redhat.com    


[-- Attachment #2: func_benchmark.bt --]
[-- Type: text/plain, Size: 1475 bytes --]

#!/usr/bin/env bpftrace
/**
 * Print durations and invocations
 * Call this script with the duration in seconds as argument
 * e.g. bpftrace func_benchmark.bt 30
 */

//tracepoint:sched:sched_wakeup
fentry:try_to_wake_up
{
  if(args->p->mm != 0) {
    @_mms[args->p->mm] = true;
    @_processes[args->p->tgid] = true;
    @_threads[args->p->pid] = true;
  }
}

fentry:task_mm_cid_work
{
  @start[tid] = nsecs;
  @preemptions[tid] = (uint64)0;
}

fexit:task_mm_cid_work
/@start[tid]/
{
  $curr_preemption = @preempted[tid] ? @preemptions[tid] : 0;
  $duration = (nsecs - @start[tid] - $curr_preemption)/1000;
  @durations = lhist($duration, 10, 100, 5);
  @duration_total = stats($duration);
  @duration_max = max($duration);
  delete(@start[tid]);
  delete(@preemptions[tid]);
  delete(@preempted[tid]);
}

/* Support only one preemption, should be fine for non-sleeping functions */
tracepoint:sched:sched_switch
// /@start[args.prev_pid] || @start[args.next_pid]/
{
  if (@start[args.prev_pid]) {
    @preempted[args.prev_pid] = true;
    @preemptions[args.prev_pid] = nsecs;
  }
  if (@start[args.next_pid] && @preempted[args.next_pid]) {
    @preemptions[args.next_pid] = nsecs - @preemptions[args.next_pid];
  }
}

//interval:s:30
interval:s:$1
{
  exit();
}

END
{
  @mms = len(@_mms);
  @processes = len(@_processes);
  @threads = len(@_threads);
  clear(@_mms);
  clear(@_processes);
  clear(@_threads);
  clear(@start);
  clear(@preemptions);
  clear(@preempted);
}

[-- Attachment #3: runtest_mm_cid.sh --]
[-- Type: application/x-shellscript, Size: 611 bytes --]

      parent reply	other threads:[~2024-12-13 11:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13  9:54 Gabriele Monaco
2024-12-13  9:54 ` [PATCH v2 1/4] " Gabriele Monaco
2024-12-13 14:14   ` Mathieu Desnoyers
2024-12-13 15:15     ` Gabriele Monaco
2024-12-13  9:54 ` [PATCH v2 2/4] sched: Remove mm_cid_next_scan as obsolete Gabriele Monaco
2024-12-13 14:01   ` Mathieu Desnoyers
2024-12-13  9:54 ` [PATCH v2 3/4] sched: Compact RSEQ concurrency IDs with reduced threads and affinity Gabriele Monaco
2024-12-13 14:05   ` Mathieu Desnoyers
2024-12-13  9:54 ` [PATCH v2 4/4] rseq/selftests: Add test for mm_cid compaction Gabriele Monaco
2024-12-13 14:29   ` Mathieu Desnoyers
2024-12-13 15:03     ` Gabriele Monaco
2024-12-13 11:31 ` Gabriele Monaco [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=7cf8c25f325d433c2abc473f3d877067e216ff6c.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=shuah@kernel.org \
    --cc=vincent.guittot@linaro.org \
    /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