All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>, Kan Liang <kan.liang@intel.com>,
	Dmitri Prokhorov <Dmitry.Prohorov@intel.com>,
	Valery Cherepennikov <valery.cherepennikov@intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	David Carrillo-Cisneros <davidcc@google.com>,
	Stephane Eranian <eranian@google.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups
Date: Tue, 18 Jul 2017 16:39:36 +0300	[thread overview]
Message-ID: <00247f4a-1637-b7fe-2408-07330fcb3171@linux.intel.com> (raw)
In-Reply-To: <874luavsh5.fsf@ashishki-desk.ger.corp.intel.com>

Hi,

On 18.07.2017 15:29, Alexander Shishkin wrote:
> Alexey Budankov <alexey.budankov@linux.intel.com> writes:
> 
>> +/*
>> + * Helper function to test if event groups are empty;
>> + */
>> +static int
>> +perf_event_groups_empty(struct perf_event_groups *groups)
>> +{
>> +	return list_empty(&groups->list);
>> +}
> 
> This doesn't seem useful, it's only used once. Also, it's not clear how
> access to groups->list is serialized here, but it is in the caller.

Acepted. That API is removed in the final patch where list is replaced by rbtree.

> 
> I'm assuming you will use this helper after the linked lists are done
> away with, but I'll have to go fishing for that patch to make sure.
> 
>> +static void
>> +perf_event_groups_insert(struct perf_event_groups *groups,
>> +		struct perf_event *event)
>> +{
>> +	struct rb_node **node;
>> +	struct rb_node *parent;
>> +	struct perf_event *node_event;
>> +
>> +	WARN_ON_ONCE(!groups || !event);
> 
> I'm pretty sure neither of these is plausible.

Used that for debugging. Does it affect performance somehow?

> 
>> +	WARN_ON_ONCE(!list_empty(&event->group_list_entry));
> 
> So ctx::lock is held here, right? That could be a useful assert and/or
> comment at least for review purposes. Now I see that it's called from
> list_add_event().

Agree.

> 
> Regards,
> --
> Alex
> 

Thanks,
Alexey

  reply	other threads:[~2017-07-18 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 13:03 [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups Alexey Budankov
2017-07-18 12:02 ` Alexander Shishkin
2017-07-18 13:38   ` Alexey Budankov
2017-07-18 12:29 ` Alexander Shishkin
2017-07-18 13:39   ` Alexey Budankov [this message]
2017-07-19  6:36     ` Alexander Shishkin

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=00247f4a-1637-b7fe-2408-07330fcb3171@linux.intel.com \
    --to=alexey.budankov@linux.intel.com \
    --cc=Dmitry.Prohorov@intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=davidcc@google.com \
    --cc=eranian@google.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=valery.cherepennikov@intel.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.