Hello, On Mon, Mar 22, 2021 at 3:14 PM Like Xu <like...@linux.intel.com> wrote: > +void reserve_lbr_buffers(struct perf_event *event) > +{ > + struct kmem_cache *kmem_cache = x86_get_pmu()->task_ctx_cache; > + struct cpu_hw_events *cpuc; > + int cpu; > + > + if (!static_cpu_has(X86_FEATURE_ARCH_LBR)) > + return; > + > + for_each_possible_cpu(cpu) { > + cpuc = per_cpu_ptr(&cpu_hw_events, cpu); > + if (kmem_cache && !cpuc->lbr_xsave && !event->attr.precise_ip) > + cpuc->lbr_xsave = kmem_cache_alloc(kmem_cache, > GFP_KERNEL); > + } > +}
I think we should use kmem_cache_alloc_node(). Thanks, Namhyung