From patchwork Wed Feb 20 10:11:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 222036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 51ABB2C007A for ; Wed, 20 Feb 2013 21:28:49 +1100 (EST) Received: from localhost ([::1]:34823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86ut-0005MK-G6 for incoming@patchwork.ozlabs.org; Wed, 20 Feb 2013 05:28:47 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86my-0002GQ-9Q for qemu-devel@nongnu.org; Wed, 20 Feb 2013 05:20:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U86mt-0001fg-6N for qemu-devel@nongnu.org; Wed, 20 Feb 2013 05:20:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86ms-0001fJ-UJ for qemu-devel@nongnu.org; Wed, 20 Feb 2013 05:20:31 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1KAKTbF004558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Feb 2013 05:20:30 -0500 Received: from amd-6168-8-1.englab.nay.redhat.com (amd-6168-8-1.englab.nay.redhat.com [10.66.104.52]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1KAKMEa004130; Wed, 20 Feb 2013 05:20:24 -0500 From: Jason Wang To: aliguori@us.ibm.com, qemu-devel@nongnu.org Date: Wed, 20 Feb 2013 18:11:33 +0800 Message-Id: <1361355093-52239-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang , Edivaldo de Araujo Pereira , stefanha@redhat.com, mst@redhat.com Subject: [Qemu-devel] [PATCH RESEND for 1.4-stable] net: reduce memory allocation when multiqueue is not used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Edivaldo reports a problem that the array of NetClientState in NICState is too large - MAX_QUEUE_NUM(1024) which will waste memory even if multiqueue is not used. For 1.4 we can just solve this by reduce the MAX_QUEUE_NUM to 8 which is the same as the current kernel (3.8+) tap queue limit. For 1.5, we will use dynamic allocation instead. Cc: Edivaldo de Araujo Pereira Signed-off-by: Jason Wang --- RESEND since the previous mail misses the list. --- include/net/net.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 43a045e..cdffc34 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -9,7 +9,7 @@ #include "migration/vmstate.h" #include "qapi-types.h" -#define MAX_QUEUE_NUM 1024 +#define MAX_QUEUE_NUM 8 struct MACAddr { uint8_t a[6];