Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753541AbbL2Q1R (ORCPT ); Tue, 29 Dec 2015 11:27:17 -0500 Received: from www62.your-server.de ([213.133.104.62]:59598 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752948AbbL2Q1O (ORCPT ); Tue, 29 Dec 2015 11:27:14 -0500 Message-ID: <5682B45B.40007@iogearbox.net> Date: Tue, 29 Dec 2015 17:27:07 +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: Ming Lei , linux-kernel@vger.kernel.org, Alexei Starovoitov CC: "David S. Miller" , netdev@vger.kernel.org Subject: Re: [PATCH v2 3/3] bpf: hash: use per-bucket spinlock References: <1451400027-28892-1-git-send-email-tom.leiming@gmail.com> <1451400027-28892-4-git-send-email-tom.leiming@gmail.com> In-Reply-To: <1451400027-28892-4-git-send-email-tom.leiming@gmail.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: 837 Lines: 21 On 12/29/2015 03:40 PM, Ming Lei wrote: > Both htab_map_update_elem() and htab_map_delete_elem() can be > called from eBPF program, and they may be in kernel hot path, > so it isn't efficient to use a per-hashtable lock in this two > helpers. > > The per-hashtable spinlock is used for protecting bucket's > hlist, and per-bucket lock is just enough. This patch converts > the per-hashtable lock into per-bucket spinlock, so that > contention can be decreased a lot. > > Signed-off-by: Ming Lei Looks better, thanks! Acked-by: Daniel Borkmann -- 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/