Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp516758imm; Wed, 18 Jul 2018 06:16:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfdyfM2s9aWuP8S6u54fWQFQhJM+Cz8WotM6e1wr+gpdIdot4dPhSwcFX+PGebX+6g7IMSm X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr6020741plc.82.1531919797816; Wed, 18 Jul 2018 06:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531919797; cv=none; d=google.com; s=arc-20160816; b=yt8nvzpceIuzdODrERH8KvSlVQHSy9K4/KX2ljVPsWd4Z/VRySOnFf0kayDYb2sK+W UyE9tqoSIyAK+DTy1QKBX1Z1JgalnoQ9CCCyF37XUNqEYFea7taQdTZYLjJHvvlCkppd Cp+TaqBYXJDSu2RJziAmnPbDu3NYc3rASAZjuA6Ecku5OdBucPKGerIvWJRgiarji52O MCCYGWbWi9dOKegNEgaDzRxKZfrh2FkFmFf3nxeKVnYZK+nVOGsb7nFoDKW7Hzn7t3Ro JXdp8WwKv+gPlE/5NxGfW+EW1SnGmlQZGduxDLAcq6MoC7DKW/+jVzIgMeTBP6eqiQk1 9Vwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=yqKbWV/ssIQBJZDq+pXRRmaJfMPMF50h1x9aRo6+/Pw=; b=Nu6WaPmlDQoG1HNTIrvOi8aRAM1HV/Ll10B0lYWGzvXZthmOMOW9NmMrj1yyl2C8lO AEthtXNx25EzajDvwRhAducwHR36pAt4zGIczrkFJDwdsaRxkpp1F2IKEn4rrursQCcz Ri+hc62qh2MuUxxdiGl8SqaeVI/vTt7MDSMubof+Mi4buXEsmjM7gGPymrhnvytf9tQV mcpe6HDezC92HhfqWXNKUr4hNqeh4JgOZT/jfiY3PQMrcQIqyfevBK1q9LrqmN1YrElj aOVTCAYYQXjoOhAGaj/BopbMlHccZzcUrgDHXZzI5DEJyiKoomPpzELsB13ThA1X6J+e o5/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dFVfuMSr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13-v6si2965128plp.51.2018.07.18.06.16.22; Wed, 18 Jul 2018 06:16:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dFVfuMSr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730913AbeGRNwp (ORCPT + 99 others); Wed, 18 Jul 2018 09:52:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33772 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729193AbeGRNwp (ORCPT ); Wed, 18 Jul 2018 09:52:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yqKbWV/ssIQBJZDq+pXRRmaJfMPMF50h1x9aRo6+/Pw=; b=dFVfuMSrxcVBf2kxkpxDfUUrB kra7EgvNrAaRjzChOstX7DjZ9wzDkWP+CJcu9F6A8S2B0Ton66W6/e4D9gpV8B8xcp95RYXyyl1Y6 /DOoSrYG+845JiG4nLUeXN3NHYmL7pZC/p2VarResTEJ4CA1QB5mpTcsScHJOn4UZexOmEUYxg6we Q7I4fz3LjpuqisiAQSWzJt1ectf69isrORB8OvfDNccVijOnO1cwy7mQrHcAEePwE/aV6r7CM2y0t q51KB+om22TeS4L5ujBuB8Y5D9qwLZnf8O/FGZQs+/2nk1iqBkA8l5H3AtVtxtJ5FfgQxIHw/O5+n eP2c3gQrQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffmI3-00037K-5M; Wed, 18 Jul 2018 13:14:47 +0000 Date: Wed, 18 Jul 2018 06:14:46 -0700 From: Matthew Wilcox To: Pablo Neira Ayuso Cc: Stephen Rothwell , NetFilter , Linux-Next Mailing List , Linux Kernel Mailing List , Varsha Rao Subject: Re: linux-next: build failure after merge of the ida tree Message-ID: <20180718131446.GC4949@bombadil.infradead.org> References: <20180718165406.6f262266@canb.auug.org.au> <20180718092426.mxdti3jes5jsssta@salvia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718092426.mxdti3jes5jsssta@salvia> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 18, 2018 at 11:24:26AM +0200, Pablo Neira Ayuso wrote: > > interacting with commit > > > > 9679150a0bd5 ("netfilter: nf_tables: Use id allocation") > > > > from the netfilter-next tree. > > @Varsha, I'm very sorry, but I guess I have to toss your patch, I > would prefer avoid dependencies with the IDA API by now. I've had a chance to read this patch a bit more carefully. It transforms one anti-pattern into another, so I can't say I'm a fan. The first is specific to the networking code; having a list of things with IDs, and constructing a bitmap when we need to allocate a new ID. The second is having both an IDA and a list of things. The more effective way to do all of this is to use an IDR. You can get rid of the linked list *and* the IDA, and it's faster to iterate over. The root of the IDR is the same size as the list_head, and then you need only store the 4-byte ID in each element instead of the 16-byte list_head. So Varsha, if you would like to take a look at transforming table->sets from a LIST_HEAD to an IDR, I think that would be a great use of your time.