lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7ci7qj47xDC3z2AzYGjnFdPRNsuEPGivZ1_re-XGhoBwMg@mail.gmail.com>
Date:   Wed, 24 Mar 2021 10:32:41 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Like Xu <like.xu@...ux.intel.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>,
        Kan Liang <kan.liang@...ux.intel.com>, x86@...nel.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 RESEND 3/5] perf/x86/lbr: Move cpuc->lbr_xsave
 allocation out of sleeping region

Hello,

On Mon, Mar 22, 2021 at 3:14 PM Like Xu <like.xu@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ