From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932470AbcITIgK (ORCPT ); Tue, 20 Sep 2016 04:36:10 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35808 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159AbcITIgI (ORCPT ); Tue, 20 Sep 2016 04:36:08 -0400 Date: Tue, 20 Sep 2016 17:43:14 +0900 From: AKASHI Takahiro To: Jason Wessel Cc: catalin.marinas@arm.com, will.deacon@arm.com, broonie@kernel.org, yong.zhao@amd.com, Vijaya.Kumar@caviumnetworks.com, kgdb-bugreport@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH] arm64: kgdb: fix single stepping Message-ID: <20160920084312.GF30248@linaro.org> Mail-Followup-To: AKASHI Takahiro , Jason Wessel , catalin.marinas@arm.com, will.deacon@arm.com, broonie@kernel.org, yong.zhao@amd.com, Vijaya.Kumar@caviumnetworks.com, kgdb-bugreport@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org References: <1429578793-3971-1-git-send-email-takahiro.akashi@linaro.org> <0ea7dfad-e25d-2919-2d03-17b850d7ba91@windriver.com> <20160916043218.GA30248@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jason, On Mon, Sep 19, 2016 at 05:29:36PM -0500, Jason Wessel wrote: > On 09/15/2016 11:32 PM, AKASHI Takahiro wrote: > >@@ -176,18 +183,14 @@ int kgdb_arch_handle_exception(int exception_vector, int signo, > >>> * over and over again. > >>> */ > >>> kgdb_arch_update_addr(linux_regs, remcom_in_buffer); > >>>- atomic_set(&kgdb_cpu_doing_single_step, -1); > >>>- kgdb_single_step = 0; > >> > >>This is a subtle change, but I assume it is what you intended? All the CPUs will get released into the run state when exiting the kgdb exception handler. > >You are talking about "- kgdb_single_step = 0." Right? > > > Correct. > > >Do you think that there is any (negative) side effect of this change? > > > Not at all. The kernel debugger always skids to a stop, and it is more reliable from a locking perspective if the other CPU threads are released while a single CPU is asked to single step until the next "skid" for all the other CPUs. > > When you do not release the other CPUs you can end up single stepping a CPU which dead locks or never exits a lock elsewhere due to what ever it was blocking on never getting freed from another CPU. Thank you for the explanation. This convinces me very much. -Takahiro AKASHI > Cheers, > Jason.