Re: [PATCH RFC] hist lookups

From: David Miller
Date: Thu Nov 08 2018 - 01:04:28 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Date: Wed, 7 Nov 2018 17:28:15 -0300

> So perhaps we should tell the kernel that is ok to lose SAMPLEs but not
> the other events, and make userspace ask for PERF_RECORD_!SAMPLE in all
> ring buffers? Duplication wouldn't be that much of a problem?

I think we should strive to keep the policy in userspace.

The kernel simply provides the events that happen, and the user's
job is to take the events in sort of a "high priority interrupt"
context and push the slow path processing to a separate thread of
execution where drop policy can be implemented.

Jiri's work provides a framework for exactly that.

So what we can have is:

cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 ... cpuN
| | | | | | |
----------------------------------------
|
|
| single event ring buffer
|
|
ultra-fast perf event dequeue
queues in-order to event processing
|
event processing slow path
prioritization and drop policy
histogram insert
etc.