Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752336AbaKZHkf (ORCPT ); Wed, 26 Nov 2014 02:40:35 -0500 Received: from mx3-phx2.redhat.com ([209.132.183.24]:43931 "EHLO mx3-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752113AbaKZHke (ORCPT ); Wed, 26 Nov 2014 02:40:34 -0500 Date: Wed, 26 Nov 2014 02:40:14 -0500 (EST) From: Pankaj Gupta To: David Miller Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jasowang@redhat.com, dgibson@redhat.com, vfalico@gmail.com, edumazet@google.com, vyasevic@redhat.com, hkchu@google.com, xemul@parallels.com, therbert@google.com, bhutchings@solarflare.com, xii@google.com, stephen@networkplumber.org, jiri@resnulli.us, sergei shtylyov , "Michael S. Tsirkin" Message-ID: <538874253.4658840.1416987614805.JavaMail.zimbra@redhat.com> In-Reply-To: <20141125.132717.122094133335261929.davem@davemloft.net> References: <1416854044-10124-1-git-send-email-pagupta@redhat.com> <20141125.132717.122094133335261929.davem@davemloft.net> Subject: Re: [PATCH v2 net-next 3/3] tuntap: reduce the size of tun_struct by using flex array. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.5.82.6] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF23 (Linux)/8.0.6_GA_5922) Thread-Topic: tuntap: reduce the size of tun_struct by using flex array. Thread-Index: 4PwEqcvOiZYqviY4KNbhrjkiOLUdkA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > From: Pankaj Gupta > Date: Tue, 25 Nov 2014 00:04:04 +0530 > > > This patch switches to flex array to implement the flow caches, it brings > > several advantages: > > > > - Reduce the size of the tun_struct structure, which allows us to increase > > the > > upper limit of queues in future. > > - Avoid higher order memory allocation. It will be useful when switching to > > pure hashing in flow cache which may demand a larger size array in > > future. > > > > After this patch, the size of tun_struct on x86_64 reduced from 8512 to > > 328 > > > > Signed-off-by: Jason Wang > > Signed-off-by: Pankaj Gupta > > Reviewed-by: David Gibson > > I see no reason to use flex arrays for this, you are preallocaing the > memory so if anything flex array is adding an unnecessary level of > redirection for every access in return for no real gains. > > Just allocate the thing normally using kzalloc() or whatever. I agree. Will do the changes and submit v3. > -- > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- 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/