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


Groups > linux.kernel > #1690273

Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups

From Alexey Budankov <alexey.budankov@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups
Date 2017-07-18 15:40 +0200
Message-ID <u4ATf-2Z9-17@gated-at.bofh.it> (permalink)
References <u1GBP-5sk-19@gated-at.bofh.it> <u4zNw-2nc-27@gated-at.bofh.it>
Organization Intel Corp.

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups Alexey Budankov <alexey.budankov@linux.intel.com> - 2017-07-10 15:10 +0200
  Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-07-18 14:10 +0200
    Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible  groups Alexey Budankov <alexey.budankov@linux.intel.com> - 2017-07-18 15:40 +0200
  Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-07-18 14:30 +0200
    Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible  groups Alexey Budankov <alexey.budankov@linux.intel.com> - 2017-07-18 15:40 +0200
      Re: [PATCH v5 1/4]: perf/core: use rb trees for pinned/flexible groups Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-07-19 08:40 +0200

csiph-web