Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-04-11 Thread Mark Rutland
On Wed, Apr 11, 2018 at 02:30:28PM +0800, Ji.Zhang wrote: > On Mon, 2018-04-09 at 12:26 +0100, Mark Rutland wrote: > > On Sun, Apr 08, 2018 at 03:58:48PM +0800, Ji.Zhang wrote: > > > Yes, I see where the loop is, I have missed that the loop may cross > > > different stacks. > > > Define a nesting

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-04-11 Thread Mark Rutland
On Wed, Apr 11, 2018 at 02:30:28PM +0800, Ji.Zhang wrote: > On Mon, 2018-04-09 at 12:26 +0100, Mark Rutland wrote: > > On Sun, Apr 08, 2018 at 03:58:48PM +0800, Ji.Zhang wrote: > > > Yes, I see where the loop is, I have missed that the loop may cross > > > different stacks. > > > Define a nesting

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-04-09 Thread Mark Rutland
On Sun, Apr 08, 2018 at 03:58:48PM +0800, Ji.Zhang wrote: > Yes, I see where the loop is, I have missed that the loop may cross > different stacks. > Define a nesting order and check against is a good idea, and it can > resolve the issue exactly, but as you mentioned before, we have no idea > how

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-04-09 Thread Mark Rutland
On Sun, Apr 08, 2018 at 03:58:48PM +0800, Ji.Zhang wrote: > Yes, I see where the loop is, I have missed that the loop may cross > different stacks. > Define a nesting order and check against is a good idea, and it can > resolve the issue exactly, but as you mentioned before, we have no idea > how

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-04-04 Thread Mark Rutland
On Fri, Mar 30, 2018 at 04:08:12PM +0800, Ji.Zhang wrote: > On Wed, 2018-03-28 at 11:12 +0100, Mark Rutland wrote: > > On Wed, Mar 28, 2018 at 05:33:32PM +0800, Ji.Zhang wrote: > > > > I'm very much not keen on this. > > > > I think that if we're going to do this, the only sane way to do it is

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-04-04 Thread Mark Rutland
On Fri, Mar 30, 2018 at 04:08:12PM +0800, Ji.Zhang wrote: > On Wed, 2018-03-28 at 11:12 +0100, Mark Rutland wrote: > > On Wed, Mar 28, 2018 at 05:33:32PM +0800, Ji.Zhang wrote: > > > > I'm very much not keen on this. > > > > I think that if we're going to do this, the only sane way to do it is

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-28 Thread Mark Rutland
On Wed, Mar 28, 2018 at 05:33:32PM +0800, Ji.Zhang wrote: > On Mon, 2018-03-26 at 12:39 +0100, Mark Rutland wrote: > > I think that it would be preferable to try to avoid the inifinite loop > > case. We could hit that by accident if we're tracing a live task. > > > > It's a little tricky to

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-28 Thread Mark Rutland
On Wed, Mar 28, 2018 at 05:33:32PM +0800, Ji.Zhang wrote: > On Mon, 2018-03-26 at 12:39 +0100, Mark Rutland wrote: > > I think that it would be preferable to try to avoid the inifinite loop > > case. We could hit that by accident if we're tracing a live task. > > > > It's a little tricky to

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-26 Thread Mark Rutland
On Thu, Mar 22, 2018 at 05:35:29PM +0800, Ji.Zhang wrote: > On Thu, 2018-03-22 at 05:59 +, Mark Rutland wrote: > > On Thu, Mar 22, 2018 at 11:06:00AM +0800, Ji Zhang wrote: > > > When we dump the backtrace of some specific task, there is a potential > > > race > > > condition due to the task

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-26 Thread Mark Rutland
On Thu, Mar 22, 2018 at 05:35:29PM +0800, Ji.Zhang wrote: > On Thu, 2018-03-22 at 05:59 +, Mark Rutland wrote: > > On Thu, Mar 22, 2018 at 11:06:00AM +0800, Ji Zhang wrote: > > > When we dump the backtrace of some specific task, there is a potential > > > race > > > condition due to the task

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-24 Thread kbuild test robot
Hi Ji, Thank you for the patch! Yet something to improve: [auto build test ERROR on arm64/for-next/core] [also build test ERROR on v4.16-rc6 next-20180323] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-24 Thread kbuild test robot
Hi Ji, Thank you for the patch! Yet something to improve: [auto build test ERROR on arm64/for-next/core] [also build test ERROR on v4.16-rc6 next-20180323] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-22 Thread Mark Rutland
On Thu, Mar 22, 2018 at 11:06:00AM +0800, Ji Zhang wrote: > When we dump the backtrace of some specific task, there is a potential race > condition due to the task may be running on other cores if SMP enabled. > That is because for current implementation, if the task is not the current > task, we

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-22 Thread Mark Rutland
On Thu, Mar 22, 2018 at 11:06:00AM +0800, Ji Zhang wrote: > When we dump the backtrace of some specific task, there is a potential race > condition due to the task may be running on other cores if SMP enabled. > That is because for current implementation, if the task is not the current > task, we

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-21 Thread Baruch Siach
Hi Ji Zhang, On Thu, Mar 22, 2018 at 11:06:00AM +0800, Ji Zhang wrote: > When we dump the backtrace of some specific task, there is a potential race > condition due to the task may be running on other cores if SMP enabled. > That is because for current implementation, if the task is not the

Re: [PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-21 Thread Baruch Siach
Hi Ji Zhang, On Thu, Mar 22, 2018 at 11:06:00AM +0800, Ji Zhang wrote: > When we dump the backtrace of some specific task, there is a potential race > condition due to the task may be running on other cores if SMP enabled. > That is because for current implementation, if the task is not the

[PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-21 Thread Ji Zhang
When we dump the backtrace of some specific task, there is a potential race condition due to the task may be running on other cores if SMP enabled. That is because for current implementation, if the task is not the current task, we will get the registers used for unwind from cpu_context saved in

[PATCH] arm64: avoid race condition issue in dump_backtrace

2018-03-21 Thread Ji Zhang
When we dump the backtrace of some specific task, there is a potential race condition due to the task may be running on other cores if SMP enabled. That is because for current implementation, if the task is not the current task, we will get the registers used for unwind from cpu_context saved in