[ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org --- drivers/hwtracing/coresight/coresight-etb10.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index 0dad8626bcfb..6cf28b049635 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -275,9 +275,7 @@ static void *etb_alloc_buffer(struct coresight_device *csdev, int cpu, int node; struct cs_buffers *buf;
- if (cpu == -1) - cpu = smp_processor_id(); - node = cpu_to_node(cpu); + node = (cpu == -1) ? NUMA_NO_NODE : cpu_to_node(cpu);
buf = kzalloc_node(sizeof(struct cs_buffers), GFP_KERNEL, node); if (!buf)
[ Upstream commit 024c1fd9dbcc1d8a847f1311f999d35783921b7f ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544 caller is tmc_alloc_etf_buffer+0x5c/0x60 CPU: 2 PID: 2544 Comm: perf Not tainted 5.1.0-rc6-147786-g116841e #344 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Feb 1 2019 Call trace: dump_backtrace+0x0/0x150 show_stack+0x14/0x20 dump_stack+0x9c/0xc4 debug_smp_processor_id+0x10c/0x110 tmc_alloc_etf_buffer+0x5c/0x60 etm_setup_aux+0x1c4/0x230 rb_alloc_aux+0x1b8/0x2b8 perf_mmap+0x35c/0x478 mmap_region+0x34c/0x4f0 do_mmap+0x2d8/0x418 vm_mmap_pgoff+0xd0/0xf8 ksys_mmap_pgoff+0x88/0xf8 __arm64_sys_mmap+0x28/0x38 el0_svc_handler+0xd8/0x138 el0_svc+0x8/0xc
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2e499bbc1a929ac ("coresight: tmc: implementing TMC-ETF AUX space API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-4-mathieu.poirier@linaro.org --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index e31061308e19..e90af39283b1 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -304,9 +304,7 @@ static void *tmc_alloc_etf_buffer(struct coresight_device *csdev, int cpu, int node; struct cs_buffers *buf;
- if (cpu == -1) - cpu = smp_processor_id(); - node = cpu_to_node(cpu); + node = (cpu == -1) ? NUMA_NO_NODE : cpu_to_node(cpu);
/* Allocate memory structure for interaction with Perf */ buf = kzalloc_node(sizeof(struct cs_buffers), GFP_KERNEL, node);
On Wed, Jan 08, 2020 at 11:05:40AM +0000, Suzuki K Poulose wrote:
[ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org
I've queued this for 4.9-4.19. There was a simple conflict on 4.9 which also had to be resolved.
On 09/01/2020 14:35, Sasha Levin wrote:
On Wed, Jan 08, 2020 at 11:05:40AM +0000, Suzuki K Poulose wrote:
[ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org
I've queued this for 4.9-4.19. There was a simple conflict on 4.9 which also had to be resolved.
Thanks Sasha !
Suzuki
On Thu, Jan 09, 2020 at 02:36:17PM +0000, Suzuki Kuruppassery Poulose wrote:
On 09/01/2020 14:35, Sasha Levin wrote:
On Wed, Jan 08, 2020 at 11:05:40AM +0000, Suzuki K Poulose wrote:
[ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org
I've queued this for 4.9-4.19. There was a simple conflict on 4.9 which also had to be resolved.
Thanks Sasha !
Note, these had to all be dropped as they broke the build :(
So can you please send us patches that at least build? :)
thanks,
greg k-h
Hi Greg,
On 15/01/2020 15:11, Greg KH wrote:
On Thu, Jan 09, 2020 at 02:36:17PM +0000, Suzuki Kuruppassery Poulose wrote:
On 09/01/2020 14:35, Sasha Levin wrote:
On Wed, Jan 08, 2020 at 11:05:40AM +0000, Suzuki K Poulose wrote:
[ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org
I've queued this for 4.9-4.19. There was a simple conflict on 4.9 which also had to be resolved.
Thanks Sasha !
Note, these had to all be dropped as they broke the build :(
So can you please send us patches that at least build? :)
Do you have a build failure log ? I did build test it before sending it over. I tried it again on 4.9, 4.14 and 4.19. I don't hit any build failures here.
Please could you share the log if you have it handy ?
Suzuki
On Wed, Jan 15, 2020 at 04:44:29PM +0000, Suzuki Kuruppassery Poulose wrote:
Hi Greg,
On 15/01/2020 15:11, Greg KH wrote:
On Thu, Jan 09, 2020 at 02:36:17PM +0000, Suzuki Kuruppassery Poulose wrote:
On 09/01/2020 14:35, Sasha Levin wrote:
On Wed, Jan 08, 2020 at 11:05:40AM +0000, Suzuki K Poulose wrote:
[ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org
I've queued this for 4.9-4.19. There was a simple conflict on 4.9 which also had to be resolved.
Thanks Sasha !
Note, these had to all be dropped as they broke the build :(
So can you please send us patches that at least build? :)
Do you have a build failure log ? I did build test it before sending it over. I tried it again on 4.9, 4.14 and 4.19. I don't hit any build failures here.
Please could you share the log if you have it handy ?
It was in the stable -rc review emails, I don't have it handy, sorry.
greg k-h
On 15/01/2020 17:21, Greg KH wrote:
On Wed, Jan 15, 2020 at 04:44:29PM +0000, Suzuki Kuruppassery Poulose wrote:
Hi Greg,
On 15/01/2020 15:11, Greg KH wrote:
On Thu, Jan 09, 2020 at 02:36:17PM +0000, Suzuki Kuruppassery Poulose wrote:
On 09/01/2020 14:35, Sasha Levin wrote:
On Wed, Jan 08, 2020 at 11:05:40AM +0000, Suzuki K Poulose wrote:
[ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ]
During a perf session we try to allocate buffers on the "node" associated with the CPU the event is bound to. If it is not bound to a CPU, we use the current CPU node, using smp_processor_id(). However this is unsafe in a pre-emptible context and could generate the splats as below :
BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544
Use NUMA_NO_NODE hint instead of using the current node for events not bound to CPUs.
Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") Cc: Mathieu Poirier mathieu.poirier@linaro.org Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com Cc: stable stable@vger.kernel.org # v4.9 to v4.19 Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org
I've queued this for 4.9-4.19. There was a simple conflict on 4.9 which also had to be resolved.
Thanks Sasha !
Note, these had to all be dropped as they broke the build :(
So can you please send us patches that at least build? :)
Do you have a build failure log ? I did build test it before sending it over. I tried it again on 4.9, 4.14 and 4.19. I don't hit any build failures here.
Please could you share the log if you have it handy ?
It was in the stable -rc review emails, I don't have it handy, sorry.
I think there is a bit of confusion here. If you're referring to
https://lkml.org/lkml/2020/1/11/634
as the build failure report, this is precisely my series fixes. I sent this series to address the build break reported by Nathan. The original patches were picked up from the "Fixes" tag automatically which broke the build due to missing "event" parameter. This series fixes those build issues and for sure builds fine for the affected versions. Trust me ;-)
Cheers Suzuki
greg k-h
On Wed, Jan 15, 2020 at 05:28:19PM +0000, Suzuki Kuruppassery Poulose wrote:
On 15/01/2020 17:21, Greg KH wrote:
On Wed, Jan 15, 2020 at 04:44:29PM +0000, Suzuki Kuruppassery Poulose wrote:
Hi Greg,
On 15/01/2020 15:11, Greg KH wrote:
On Thu, Jan 09, 2020 at 02:36:17PM +0000, Suzuki Kuruppassery Poulose wrote:
On 09/01/2020 14:35, Sasha Levin wrote:
On Wed, Jan 08, 2020 at 11:05:40AM +0000, Suzuki K Poulose wrote: > [ Upstream commit 730766bae3280a25d40ea76a53dc6342e84e6513 ] > > During a perf session we try to allocate buffers on the "node" associated > with the CPU the event is bound to. If it is not bound to a CPU, we > use the current CPU node, using smp_processor_id(). However this is > unsafe > in a pre-emptible context and could generate the splats as below : > > BUG: using smp_processor_id() in preemptible [00000000] code: perf/2544 > > Use NUMA_NO_NODE hint instead of using the current node for events > not bound to CPUs. > > Fixes: 2997aa4063d97fdb39 ("coresight: etb10: implementing AUX API") > Cc: Mathieu Poirier mathieu.poirier@linaro.org > Signed-off-by: Suzuki K Poulose suzuki.poulose@arm.com > Cc: stable stable@vger.kernel.org # v4.9 to v4.19 > Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org > Link: https://lore.kernel.org/r/20190620221237.3536-5-mathieu.poirier@linaro.org >
I've queued this for 4.9-4.19. There was a simple conflict on 4.9 which also had to be resolved.
Thanks Sasha !
Note, these had to all be dropped as they broke the build :(
So can you please send us patches that at least build? :)
Do you have a build failure log ? I did build test it before sending it over. I tried it again on 4.9, 4.14 and 4.19. I don't hit any build failures here.
Please could you share the log if you have it handy ?
It was in the stable -rc review emails, I don't have it handy, sorry.
I think there is a bit of confusion here. If you're referring to
https://lkml.org/lkml/2020/1/11/634
as the build failure report, this is precisely my series fixes. I sent this series to address the build break reported by Nathan. The original patches were picked up from the "Fixes" tag automatically which broke the build due to missing "event" parameter. This series fixes those build issues and for sure builds fine for the affected versions. Trust me ;-)
Ok, for some reason it looked like the "original" commits were added to the tree, not your backports. I've queued up your backports now, that should solve the issue.
thanks,
greg k-h
linux-stable-mirror@lists.linaro.org