Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753919AbbGWBjS (ORCPT ); Wed, 22 Jul 2015 21:39:18 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:35470 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196AbbGWBjQ (ORCPT ); Wed, 22 Jul 2015 21:39:16 -0400 Subject: Re: [PATCH v2 1/5] bpf: Add new bpf map type to store the pointer to struct perf_event To: "Wangnan (F)" , Kaixu Xia , davem@davemloft.net, acme@kernel.org, mingo@redhat.com, a.p.zijlstra@chello.nl, masami.hiramatsu.pt@hitachi.com, jolsa@kernel.org References: <1437552572-84748-1-git-send-email-xiakaixu@huawei.com> <1437552572-84748-2-git-send-email-xiakaixu@huawei.com> <55B039F7.8060706@plumgrid.com> <55B03E99.7000803@huawei.com> Cc: linux-kernel@vger.kernel.org, pi3orama@163.com, hekuang@huawei.com From: Alexei Starovoitov Message-ID: <55B045C0.3080606@plumgrid.com> Date: Wed, 22 Jul 2015 18:39:12 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <55B03E99.7000803@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 716 Lines: 17 On 7/22/15 6:08 PM, Wangnan (F) wrote: > Then we should find another way to prevent user create a large map but > only use > a small portion of it, since normal array map can't report whether a > slot is used > or not. When releasing the map, we have to release each perf event. > Currently the only > way is to check map value in each slot. yeah. In prog_array each element is either NULL ptr or valid 'struct bpf_prog *'. Why not to do the same for perf_event_array? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/