[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b3e5dd32-5231-36fa-fe97-136aa98f1bef@arm.com>
Date: Thu, 30 May 2019 16:52:40 +0100
From: Suzuki K Poulose <suzuki.poulose@....com>
To: robin.murphy@....com, mathieu.poirier@...aro.org
Cc: coresight@...ts.linaro.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/4] coresight: tmc-etr: Do not call smp_processor_id()
from preemptible
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
Powered by blists - more mailing lists