From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760916AbcBYQnx (ORCPT ); Thu, 25 Feb 2016 11:43:53 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:30242 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759877AbcBYQnu (ORCPT ); Thu, 25 Feb 2016 11:43:50 -0500 Subject: Re: [PATCH net-next 2/3] bpf: introduce BPF_MAP_TYPE_STACK_TRACE To: Peter Zijlstra References: <1455767939-2700534-1-git-send-email-ast@fb.com> <1455767939-2700534-3-git-send-email-ast@fb.com> <20160225142328.GN6357@twins.programming.kicks-ass.net> CC: "David S. Miller" , Ingo Molnar , Steven Rostedt , Wang Nan , Daniel Borkmann , Brendan Gregg , , From: Alexei Starovoitov Message-ID: <56CF2F00.2020608@fb.com> Date: Thu, 25 Feb 2016 08:42:40 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160225142328.GN6357@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-02-25_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/25/16 6:23 AM, Peter Zijlstra wrote: >> + id = hash & (smap->n_buckets - 1); > Its not at all clear where the corresponding rcu_read_lock() is at. > >> >+ bucket = rcu_dereference(smap->buckets[id]); bpf programs of all types are always executing under rcu_read_lock(). This is fundamental for maps and majority of the helpers that's why there is no WARN_ON(rcu_read_lock_held) in this helper, since we already have it in many other places. The rcu_read_lock() for kprobe type is in trace_call_bpf().