From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12EFBC3B1BF for ; Fri, 14 Feb 2020 19:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF78F206D7 for ; Fri, 14 Feb 2020 19:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389008AbgBNT4f (ORCPT ); Fri, 14 Feb 2020 14:56:35 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:56146 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387881AbgBNT4e (ORCPT ); Fri, 14 Feb 2020 14:56:34 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j2h4P-00065q-EI; Fri, 14 Feb 2020 20:56:13 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 9BCA7101304; Fri, 14 Feb 2020 20:56:12 +0100 (CET) From: Thomas Gleixner To: Mathieu Desnoyers Cc: LKML , David Miller , bpf@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Sebastian Sewior , Peter Zijlstra , Clark Williams , Steven Rostedt , Juri Lelli , Ingo Molnar Subject: Re: [RFC patch 14/19] bpf: Use migrate_disable() in hashtab code In-Reply-To: <20200214191126.lbiusetaxecdl3of@localhost> References: <20200214133917.304937432@linutronix.de> <20200214161504.325142160@linutronix.de> <20200214191126.lbiusetaxecdl3of@localhost> Date: Fri, 14 Feb 2020 20:56:12 +0100 Message-ID: <87imk9t02r.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Desnoyers writes: > On 14-Feb-2020 02:39:31 PM, Thomas Gleixner wrote: >> Replace the preempt_disable/enable() pairs with migrate_disable/enable() >> pairs to prepare BPF to work on PREEMPT_RT enabled kernels. On a non-RT >> kernel this maps to preempt_disable/enable(), i.e. no functional change. ... > Having all those events randomly and silently discarded might be quite > unexpected from a user standpoint. This turns the deadlock prevention > mechanism into a random tracepoint-dropping facility, which is > unsettling. Well, it randomly drops events which might be unrelated to the syscall target today already, this will just drop some more. Shrug. > One alternative approach we could consider to solve this is to make > this deadlock prevention nesting counter per-thread rather than > per-cpu. That should work both on !RT and RT. > Also, I don't think using __this_cpu_inc() without preempt-disable or > irq off is safe. You'll probably want to move to this_cpu_inc/dec > instead, which can be heavier on some architectures. Good catch. Thanks, tglx