linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH v2] trace: Add migrate-disabled counter to tracing output.
Date: Thu, 2 Sep 2021 09:16:50 +0200	[thread overview]
Message-ID: <20210902071650.azcpx6nzjox3ymxe@linutronix.de> (raw)
In-Reply-To: <20210810132625.ylssabmsrkygokuv@linutronix.de>

On 2021-08-10 15:26:26 [+0200], To Steven Rostedt wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
> 
> migrate_disable() forbids task migration to another CPU. It is available
> since v5.11 and has already users such as highmem or BPF. It is useful
> to observe this task state in tracing which already has other states
> like the preemption counter.
> 
> Instead of adding the migrate disable counter as a new entry to struct
> trace_entry, which would extend the whole struct by four bytes, it is
> squashed into the preempt-disable counter. The lower four bits represent
> the preemption counter, the upper four bits represent the migrate
> disable counter. Both counter shouldn't exceed 15 but if they do, there
> is a safety net which caps the value at 15.
> 
> Add the migrate-disable counter to the trace entry so it shows up in the
> trace. Due to the users mentioned above, it is already possible to
> observe it:
> 
> |  bash-1108    [000] ...21    73.950578: rss_stat: mm_id=2213312838 curr=0 type=MM_ANONPAGES size=8192B
> |  bash-1108    [000] d..31    73.951222: irq_disable: caller=flush_tlb_mm_range+0x115/0x130 parent=ptep_clear_flush+0x42/0x50
> |  bash-1108    [000] d..31    73.951222: tlb_flush: pages:1 reason:local mm shootdown (3)
> 
> The last value is the migrate-disable counter.
> 
> Things that popped up:
> - trace_print_lat_context() does not print the migrate counter. Not sure
>   if it should. It is used in "verbose" mode and uses 8 digits and I'm
>   not sure ther is something processing the value.
> 
> - trace_define_common_fields() now defines a different variable. This
>   probably breaks things. No ide what to do in order to preserve the old
>   behaviour. Since this is used as a filter it should be split somehow
>   to be able to match both nibbles here.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> [bigeasy: patch description.]
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> v1…v2:
>   - use the upper nibble of the preemption counter for the migrate
>     disable counter and the lower for the preemption counter. This
>     avoids extending the struct by four bytes due to alignment /
>     padding.
 
 Ping.

Sebastian

  reply	other threads:[~2021-09-02  7:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 16:49 [PATCH] trace: Add migrate-disabled counter to tracing output Sebastian Andrzej Siewior
2021-08-06 17:51 ` Steven Rostedt
2021-08-06 18:10   ` Sebastian Andrzej Siewior
2021-08-10 13:26   ` [PATCH v2] " Sebastian Andrzej Siewior
2021-09-02  7:16     ` Sebastian Andrzej Siewior [this message]
2021-09-03 22:50       ` Steven Rostedt
2021-09-03 23:42     ` Steven Rostedt
2021-09-06  8:13       ` Sebastian Andrzej Siewior
2021-09-07 15:21         ` Steven Rostedt
2021-09-07 15:24           ` Sebastian Andrzej Siewior

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=20210902071650.azcpx6nzjox3ymxe@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).