Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757113Ab0FIJWo (ORCPT ); Wed, 9 Jun 2010 05:22:44 -0400 Received: from mga02.intel.com ([134.134.136.20]:54361 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756924Ab0FIJWl convert rfc822-to-8bit (ORCPT ); Wed, 9 Jun 2010 05:22:41 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,390,1272870000"; d="scan'208";a="525275526" From: "Xin, Xiaohui" To: Mitchell Erblich , Andi Kleen CC: Stephen Hemminger , "netdev@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mst@redhat.com" , "mingo@elte.hu" , "davem@davemloft.net" , "herbert@gondor.apana.org.au" , "jdike@linux.intel.com" Date: Wed, 9 Jun 2010 17:22:12 +0800 Subject: RE: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external. Thread-Topic: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external. Thread-Index: AcsGGdPTLppi3qF+TVu/wWCRm2nUgQBlzHLg Message-ID: References: <1275732899-5423-1-git-send-email-xiaohui.xin@intel.com> <20100606161348.427822fb@nehalam> <87pr03gu1c.fsf@basil.nowhere.org> <40119F5E-A745-4C50-8053-D5A701266AD5@earthlink.net> In-Reply-To: <40119F5E-A745-4C50-8053-D5A701266AD5@earthlink.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2887 Lines: 78 >-----Original Message----- >From: Mitchell Erblich [mailto:erblichs@earthlink.net] >Sent: Monday, June 07, 2010 4:17 PM >To: Andi Kleen >Cc: Stephen Hemminger; Xin, Xiaohui; netdev@vger.kernel.org; kvm@vger.kernel.org; >linux-kernel@vger.kernel.org; mst@redhat.com; mingo@elte.hu; davem@davemloft.net; >herbert@gondor.apana.org.au; jdike@linux.intel.com >Subject: Re: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external. > > >On Jun 7, 2010, at 12:51 AM, Andi Kleen wrote: > >> Stephen Hemminger writes: >> >>> Still not sure this is a good idea for a couple of reasons: >>> >>> 1. We already have lots of special cases with skb's (frags and fraglist), >>> and skb's travel through a lot of different parts of the kernel. So any >>> new change like this creates lots of exposed points for new bugs. Look >>> at cases like MD5 TCP and netfilter, and forwarding these SKB's to ipsec >>> and ppp and ... >>> >>> 2. SKB's can have infinite lifetime in the kernel. If these buffers come from >>> a fixed size pool in an external device, they can easily all get tied up >>> if you have a slow listener. What happens then? >> >> 3. If they come from an internal pool what happens when the kernel runs >> low on memory? How is that pool balanced against other kernel >> memory users? >> >> -Andi >> >> -- >> ak@linux.intel.com -- Speaking for myself only. > >In general, > >When an internal pool is created/used, their SHOULD be a reason. >Maybe, to keep allocation latency to a min, OR ... > The internal pool here is a collection of user buffers submitted by guest virtio-net driver. Guest put buffers here and driver get buffers from it. If guest submit more buffers then driver needs, we need somewhere to put the buffers, it's the internal pool here to deal with. >Now IMO, > >internal pool objects should have a ref count and >if that count is 0, then under memory pressure and/or num >of objects are above a high water mark, then they are freed, > >OR if there is a last reference age field, then the object is to be >cleaned if dirty, then freed, > >Else, the pool is allowed to grow if the number of objects in the >pool is below a set max (max COULD equal Infinity). Thanks for the thoughts. Basically, the size of the internal pool is not decided by the pool itself, To add/delete the objects in the pool is not a task of the pool itself too. It's decided by guest virtio-net driver and vhost-net driver both, and decided by the guest receive speed and submit speed. The max size of the pool is limited by the virtqueue buffer numbers. Thanks Xiaohui > > > >Mitchell Erblich -- 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/