lkml.org 
[lkml]   [2019]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/4] coresight: tmc-etr: Do not call smp_processor_id() from preemptible
From
Date
Hi Robin,

On 10/05/2019 11:38, Robin Murphy wrote:
> Hi Suzuki,
>
> On 10/05/2019 10:31, Suzuki K Poulose wrote:
>> Instead of using smp_processor_id() to figure out the node,
>> use the numa_node_id() for the current CPU node to avoid
>> splats like :


>
>> diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
>> index 793639f..cae9d8a 100644
>> --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
>> +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
>> @@ -1323,13 +1323,11 @@ static struct etr_perf_buffer *
>> tmc_etr_setup_perf_buf(struct tmc_drvdata *drvdata, struct perf_event *event,
>> int nr_pages, void **pages, bool snapshot)
>> {
>> - int node, cpu = event->cpu;
>> + int node;
>> struct etr_buf *etr_buf;
>> struct etr_perf_buffer *etr_perf;
>>
>> - if (cpu == -1)
>> - cpu = smp_processor_id();
>> - node = cpu_to_node(cpu);
>> + node = (event->cpu == -1) ? numa_node_id() : cpu_to_node(event->cpu);
>
> If cpu == -1 represents a "don't care" scenario, it might be clearer to
> just use NUMA_NO_NODE instead, and let the allocator handle it.

Thanks for the suggestion, will use that instead

Cheers
Suzuki

\
 
 \ /
  Last update: 2019-05-30 17:52    [W:0.041 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site