From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH bpf-next v2] bpf: Allow bpf_current_task_under_cgroup in interrupt Date: Sun, 29 Apr 2018 09:20:58 -0700 Message-ID: <20180429162057.7e4ofw7olx7hpris@ast-mbp> References: <20180428073235.3917719-1-qinteng@fb.com> <20180429063929.206386-1-qinteng@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, kernel-team@fb.com To: Teng Qin Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:35363 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553AbeD2QVD (ORCPT ); Sun, 29 Apr 2018 12:21:03 -0400 Received: by mail-pf0-f194.google.com with SMTP id j5so4957533pfh.2 for ; Sun, 29 Apr 2018 09:21:03 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180429063929.206386-1-qinteng@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: On Sat, Apr 28, 2018 at 11:39:29PM -0700, Teng Qin wrote: > Currently, the bpf_current_task_under_cgroup helper has a check where if > the BPF program is running in_interrupt(), it will return -EINVAL. This > prevents the helper to be used in many useful scenarios, particularly > BPF programs attached to Perf Events. > > This commit removes the check. Tested a few NMI (Perf Event) and some > softirq context, the helper returns the correct result. > > Signed-off-by: Teng Qin Applied, Thanks Teng.