All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org, Song Liu <song@kernel.org>,
	bpf@vger.kernel.org, Xi Wang <xii@google.com>
Subject: Re: [PATCH] perf lock contention: Fix spinlock and rwlock accounting
Date: Fri, 30 Aug 2024 10:23:52 -0300	[thread overview]
Message-ID: <ZtHH6JcfNUBAQAen@x1> (raw)
In-Reply-To: <20240828052953.1445862-1-namhyung@kernel.org>

On Tue, Aug 27, 2024 at 10:29:53PM -0700, Namhyung Kim wrote:
> The spinlock and rwlock use a single-element per-cpu array to track
> current locks due to performance reason.  But this means the key is
> always available and it cannot simply account lock stats in the array
> because some of them are invalid.
> 
> In fact, the contention_end() program in the BPF invalidates the entry
> by setting the 'lock' value to 0 instead of deleting the entry for the
> hashmap.  So it should skip entries with the lock value of 0 in the
> account_end_timestamp().

Thanks, applied to perf-tools-next,

- Arnaldo

  reply	other threads:[~2024-08-30 13:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  5:29 [PATCH] perf lock contention: Fix spinlock and rwlock accounting Namhyung Kim
2024-08-30 13:23 ` Arnaldo Carvalho de Melo [this message]
     [not found]   ` <CAM9d7ch27q8JycAvOqKzeG+0eXFbJ_o6qZoVSS6aUrWTpU=vdQ@mail.gmail.com>
2024-08-30 20:47     ` Arnaldo Carvalho de Melo

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=ZtHH6JcfNUBAQAen@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=song@kernel.org \
    --cc=xii@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.