[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 00/30] Code tagging framework and applications
- To: Suren Baghdasaryan <surenb@xxxxxxxxxx>
- From: Steven Rostedt <rostedt@xxxxxxxxxxx>
- Date: Mon, 5 Sep 2022 11:07:13 -0400
- Cc: Michal Hocko <mhocko@xxxxxxxx>, Kent Overstreet <kent.overstreet@xxxxxxxxx>, Mel Gorman <mgorman@xxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxx>, Johannes Weiner <hannes@xxxxxxxxxxx>, Roman Gushchin <roman.gushchin@xxxxxxxxx>, Davidlohr Bueso <dave@xxxxxxxxxxxx>, Matthew Wilcox <willy@xxxxxxxxxxxxx>, "Liam R. Howlett" <liam.howlett@xxxxxxxxxx>, David Vernet <void@xxxxxxxxxxxxx>, Juri Lelli <juri.lelli@xxxxxxxxxx>, Laurent Dufour <ldufour@xxxxxxxxxxxxx>, Peter Xu <peterx@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>, mcgrof@xxxxxxxxxx, masahiroy@xxxxxxxxxx, nathan@xxxxxxxxxx, changbin.du@xxxxxxxxx, ytcoode@xxxxxxxxx, Vincent Guittot <vincent.guittot@xxxxxxxxxx>, Dietmar Eggemann <dietmar.eggemann@xxxxxxx>, Benjamin Segall <bsegall@xxxxxxxxxx>, Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>, Valentin Schneider <vschneid@xxxxxxxxxx>, Christopher Lameter <cl@xxxxxxxxx>, Pekka Enberg <penberg@xxxxxxxxxx>, Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>, 42.hyeyoo@xxxxxxxxx, Alexander Potapenko <glider@xxxxxxxxxx>, Marco Elver <elver@xxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>, Shakeel Butt <shakeelb@xxxxxxxxxx>, Muchun Song <songmuchun@xxxxxxxxxxxxx>, arnd@xxxxxxxx, jbaron@xxxxxxxxxx, David Rientjes <rientjes@xxxxxxxxxx>, Minchan Kim <minchan@xxxxxxxxxx>, Kalesh Singh <kaleshsingh@xxxxxxxxxx>, kernel-team <kernel-team@xxxxxxxxxxx>, linux-mm <linux-mm@xxxxxxxxx>, iommu@xxxxxxxxxxxxxxx, kasan-dev@xxxxxxxxxxxxxxxx, io-uring@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, linux-modules@xxxxxxxxxxxxxxx, LKML <linux-kernel@xxxxxxxxxxxxxxx>
- Delivery-date: Mon, 05 Sep 2022 15:06:52 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sun, 4 Sep 2022 18:32:58 -0700
Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:
> Page allocations (overheads are compared to get_free_pages() duration):
> 6.8% Codetag counter manipulations (__lazy_percpu_counter_add +
> __alloc_tag_add)
> 8.8% lookup_page_ext
> 1237% call stack capture
> 139% tracepoint with attached empty BPF program
Have you tried tracepoint with custom callback?
static void my_callback(void *data, unsigned long call_site,
const void *ptr, struct kmem_cache *s,
size_t bytes_req, size_t bytes_alloc,
gfp_t gfp_flags)
{
struct my_data_struct *my_data = data;
{ do whatever }
}
[..]
register_trace_kmem_alloc(my_callback, my_data);
Now the my_callback function will be called directly every time the
kmem_alloc tracepoint is hit.
This avoids that perf and BPF overhead.
-- Steve
|