public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	linux-kernel@vger.kernel.org, eranian@google.com, tj@kernel.org,
	ak@linux.intel.com
Subject: Re: [PATCH 2/4] perf: Add filter_match() as a parameter for pinned/flexible_sched_in()
Date: Mon, 29 Apr 2019 11:31:26 -0400	[thread overview]
Message-ID: <b00952cd-9af1-3e4f-45cb-11a692e9b722@linux.intel.com> (raw)
In-Reply-To: <20190429151225.GC2182@lakrids.cambridge.arm.com>



On 4/29/2019 11:12 AM, Mark Rutland wrote:
> On Mon, Apr 29, 2019 at 07:44:03AM -0700, kan.liang@linux.intel.com wrote:
>> From: Kan Liang <kan.liang@linux.intel.com>
>>
>> A fast path will be introduced in the following patches to speed up the
>> cgroup events sched in, which only needs a simpler filter_match().
>>
>> Add filter_match() as a parameter for pinned/flexible_sched_in().
>>
>> No functional change.
> 
> I suspect that the cost you're trying to avoid is pmu_filter_match()
> iterating over the entire group, which arm systems rely upon for correct
> behaviour on big.LITTLE systems.
> 
> Is that the case?

No. In X86, we don't use pmu_filter_match(). The fast path still keeps 
this filter.
perf_cgroup_match() is the one I want to avoid.

Thanks,
Kan

> 
> Thanks,
> Mark.
> 
>>
>> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
>> ---
>>   kernel/events/core.c | 15 +++++++++------
>>   1 file changed, 9 insertions(+), 6 deletions(-)
>>
>> diff --git a/kernel/events/core.c b/kernel/events/core.c
>> index 388dd42..782fd86 100644
>> --- a/kernel/events/core.c
>> +++ b/kernel/events/core.c
>> @@ -3251,7 +3251,8 @@ static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,
>>   }
>>   
>>   static int visit_groups_merge(struct perf_event_groups *groups, int cpu,
>> -			      int (*func)(struct perf_event *, void *), void *data)
>> +			      int (*func)(struct perf_event *, void *, int (*)(struct perf_event *)),
>> +			      void *data)
>>   {
>>   	struct perf_event **evt, *evt1, *evt2;
>>   	int ret;
>> @@ -3271,7 +3272,7 @@ static int visit_groups_merge(struct perf_event_groups *groups, int cpu,
>>   			evt = &evt2;
>>   		}
>>   
>> -		ret = func(*evt, data);
>> +		ret = func(*evt, data, event_filter_match);
>>   		if (ret)
>>   			return ret;
>>   
>> @@ -3287,7 +3288,8 @@ struct sched_in_data {
>>   	int can_add_hw;
>>   };
>>   
>> -static int pinned_sched_in(struct perf_event *event, void *data)
>> +static int pinned_sched_in(struct perf_event *event, void *data,
>> +			   int (*filter_match)(struct perf_event *))
>>   {
>>   	struct sched_in_data *sid = data;
>>   
>> @@ -3300,7 +3302,7 @@ static int pinned_sched_in(struct perf_event *event, void *data)
>>   		return 0;
>>   #endif
>>   
>> -	if (!event_filter_match(event))
>> +	if (!filter_match(event))
>>   		return 0;
>>   
>>   	if (group_can_go_on(event, sid->cpuctx, sid->can_add_hw)) {
>> @@ -3318,7 +3320,8 @@ static int pinned_sched_in(struct perf_event *event, void *data)
>>   	return 0;
>>   }
>>   
>> -static int flexible_sched_in(struct perf_event *event, void *data)
>> +static int flexible_sched_in(struct perf_event *event, void *data,
>> +			     int (*filter_match)(struct perf_event *))
>>   {
>>   	struct sched_in_data *sid = data;
>>   
>> @@ -3331,7 +3334,7 @@ static int flexible_sched_in(struct perf_event *event, void *data)
>>   		return 0;
>>   #endif
>>   
>> -	if (!event_filter_match(event))
>> +	if (!filter_match(event))
>>   		return 0;
>>   
>>   	if (group_can_go_on(event, sid->cpuctx, sid->can_add_hw)) {
>> -- 
>> 2.7.4
>>

  reply	other threads:[~2019-04-29 15:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 14:44 [PATCH 0/4] Optimize cgroup context switch kan.liang
2019-04-29 14:44 ` [PATCH 1/4] perf: Fix system-wide events miscounting during cgroup monitoring kan.liang
2019-04-29 15:04   ` Mark Rutland
2019-04-29 15:27     ` Liang, Kan
2019-04-30  8:56   ` Peter Zijlstra
2019-04-30 15:45     ` Liang, Kan
2019-04-29 14:44 ` [PATCH 2/4] perf: Add filter_match() as a parameter for pinned/flexible_sched_in() kan.liang
2019-04-29 15:12   ` Mark Rutland
2019-04-29 15:31     ` Liang, Kan [this message]
2019-04-29 16:56       ` Mark Rutland
2019-04-29 14:44 ` [PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree kan.liang
2019-04-29 23:02   ` Ian Rogers
2019-04-30  9:08     ` Peter Zijlstra
2019-04-30 15:46       ` Liang, Kan
2019-04-30  9:03   ` Peter Zijlstra
2019-04-30 15:46     ` Liang, Kan
2019-04-30  9:03   ` Peter Zijlstra
2019-04-29 14:44 ` [PATCH 4/4] perf cgroup: Add fast path for cgroup switch kan.liang

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=b00952cd-9af1-3e4f-45cb-11a692e9b722@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.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