From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369Ab1JTUSA (ORCPT ); Thu, 20 Oct 2011 16:18:00 -0400 Received: from shards.monkeyblade.net ([198.137.202.13]:43254 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082Ab1JTUR6 (ORCPT ); Thu, 20 Oct 2011 16:17:58 -0400 Date: Thu, 20 Oct 2011 16:17:41 -0400 (EDT) Message-Id: <20111020.161741.1961240945982687125.davem@davemloft.net> To: mihai.maruseac@gmail.com Cc: shemminger@vyatta.com, eric.dumazet@gmail.com, mirq-linux@rere.qmqm.pl, therbert@google.com, jpirko@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dbaluta@ixiacom.com, mmaruseac@ixiacom.com Subject: Re: [PATCH] dev: use name hash for dev_seq_ops From: David Miller In-Reply-To: <1319097717-14910-1-git-send-email-mmaruseac@ixiacom.com> References: <1319097717-14910-1-git-send-email-mmaruseac@ixiacom.com> X-Mailer: Mew version 6.3 on Emacs 23.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (shards.monkeyblade.net [198.137.202.13]); Thu, 20 Oct 2011 13:17:45 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mihai Maruseac Date: Thu, 20 Oct 2011 11:01:57 +0300 > Instead of using the dev->next chain and trying to resync at each call to > dev_seq_start, use the name hash, keeping the bucket and the offset in > seq->private field. I'm totally fine with this patch from a technical perspective, but I'd like one small thing tidied up before I apply this. > + unsigned int pos; /* bucket << 24 + offset */ Please don't mention this as a constant in the comment, if we ever change NETDEV_HASHBITS this comment will be inaccurate. I'd suggest putting the BUCKET_SPACE define before the dev_iter_state definition, and using BUCKET_SPACE in the comment instead of 24. Thanks.