Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965682AbbLOXmv (ORCPT ); Tue, 15 Dec 2015 18:42:51 -0500 Received: from www62.your-server.de ([213.133.104.62]:40841 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964953AbbLOXmu (ORCPT ); Tue, 15 Dec 2015 18:42:50 -0500 Message-ID: <5670A577.3010207@iogearbox.net> Date: Wed, 16 Dec 2015 00:42:47 +0100 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alexei Starovoitov , Ming Lei CC: linux-kernel@vger.kernel.org, Alexei Starovoitov , "David S. Miller" , netdev@vger.kernel.org Subject: Re: [PATCH 5/6] bpf: hash: avoid to call kmalloc() in eBPF prog References: <1450178464-27721-1-git-send-email-tom.leiming@gmail.com> <1450178464-27721-6-git-send-email-tom.leiming@gmail.com> <20151215231057.GB67370@ast-mbp.thefacebook.com> In-Reply-To: <20151215231057.GB67370@ast-mbp.thefacebook.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 824 Lines: 16 On 12/16/2015 12:10 AM, Alexei Starovoitov wrote: ... > this rounding to cache line is great for performance, but it's extra > memory upfront which may not be needed. The per-allocation is a classic > performance vs memory trade-off. In other cases it may hurt. > So could you change the patch to do pre-allocation only when > requested by user space via extra flag for hash map or via > new BPF_MAP_TYPE_HASH_PREALLOC type? Not sure yet whether flag or > new type is better. I guess implementation will dictate. Was also thinking about this, probably new map type makes sense. -- 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/