[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6d6128d4-778f-fc9c-651b-53de199d023@os.amperecomputing.com>
Date: Fri, 10 Jan 2025 13:32:43 -0800 (PST)
From: Ilkka Koskinen <ilkka@...amperecomputing.com>
To: Suzuki K Poulose <suzuki.poulose@....com>
cc: Ilkka Koskinen <ilkka@...amperecomputing.com>,
Mike Leach <mike.leach@...aro.org>, James Clark <james.clark@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] coresight: catu: Fix number of pages while using 64k
pages
Hi Suzuko,
On Fri, 10 Jan 2025, Suzuki K Poulose wrote:
> On 09/01/2025 21:53, Ilkka Koskinen wrote:
>> Trying to record a trace on kernel with 64k pages resulted in -ENOMEM.
>> This happens due to a bug in calculating the number of table pages, which
>> returns zero. Fix the issue by rounding up.
>>
>> $ perf record --kcore -e cs_etm/@..._etr55,cycacc,branch_broadcast/k
>> --per-thread taskset --cpu-list 1 dd if=/dev/zero of=/dev/null
>> failed to mmap with 12 (Cannot allocate memory)
>>
>
> Needs a Fixes tag.
>
> Fixes : 8ed536b1e283 ("coresight: catu: Add support for scatter gather
> tables")
That's a good point
>
>> Signed-off-by: Ilkka Koskinen <ilkka@...amperecomputing.com>
>> ---
>> drivers/hwtracing/coresight/coresight-catu.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-catu.c
>> b/drivers/hwtracing/coresight/coresight-catu.c
>> index 275cc0d9f505..3378bb77e6b4 100644
>> --- a/drivers/hwtracing/coresight/coresight-catu.c
>> +++ b/drivers/hwtracing/coresight/coresight-catu.c
>> @@ -269,7 +269,7 @@ catu_init_sg_table(struct device *catu_dev, int node,
>> * Each table can address upto 1MB and we can have
>> * CATU_PAGES_PER_SYSPAGE tables in a system page.
>> */
>> - nr_tpages = DIV_ROUND_UP(size, SZ_1M) / CATU_PAGES_PER_SYSPAGE;
>> + nr_tpages = DIV_ROUND_UP(size, CATU_PAGES_PER_SYSPAGE * SZ_1M);
>> catu_table = tmc_alloc_sg_table(catu_dev, node, nr_tpages,
>> size >> PAGE_SHIFT, pages);
>> if (IS_ERR(catu_table))
>
> Looks good to me, I will queue this later for v6.15.
>
> Suzuki
Sounds great. Just to confirm, are you ok to add the fixes line or would
you prefer me to submit v2 with it?
Cheers, Ilkka
Powered by blists - more mailing lists