From mboxrd@z Thu Jan 1 00:00:00 1970 From: Song Liu Subject: Re: [PATCH bpf-next 1/2] bpf: enable stackmap with build_id in nmi context Date: Wed, 2 May 2018 17:57:31 +0000 Message-ID: <06FAC793-ADBC-44B1-8CF4-36A8C17730AD@fb.com> References: <20180502000220.2585320-1-songliubraving@fb.com> <20180502092109.GI12180@hirez.programming.kicks-ass.net> <30F32ACF-5155-459B-BD47-5060CCA52788@fb.com> <20180502173027.GM12180@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Networking , Kernel Team , Alexei Starovoitov , Daniel Borkmann To: Peter Zijlstra Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:53860 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750849AbeEBR6O (ORCPT ); Wed, 2 May 2018 13:58:14 -0400 In-Reply-To: <20180502173027.GM12180@hirez.programming.kicks-ass.net> Content-Language: en-US Content-ID: <4C9A6E0820730D40A3148B73B98AF91B@namprd15.prod.outlook.com> Sender: netdev-owner@vger.kernel.org List-ID: > On May 2, 2018, at 10:30 AM, Peter Zijlstra wrote: >=20 > On Wed, May 02, 2018 at 04:48:32PM +0000, Song Liu wrote: >>> It's broken though, I've bet you've never actually ran this with lockde= p >>> enabled for example. >>=20 >> I am not following here. I just run the new selftest with CONFIG_LOCKDEP= on,=20 >> and got no warning for this.=20 >=20 > Weird, I would be expecting complaints about releasing an unheld lock. >=20 > nmi_enter(),nmi_exit() have lockdep_off(),lockdep_on() resp. Which means > that the down_trylock() will not be recorded. The up, which is done from > IRQ context, will not be so supressed and should hit > print_unlock_imbalance_bug(). >=20 I am still not sure whether I am following. I guess your concern apply to=20 spinlock only? lock_acquire() has the following in the beginning: if (unlikely(current->lockdep_recursion)) return; So it will not run in nmi context? On the other hand, semaphore and rw_semaphore should be ok in such cases? Thanks, Song=