From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754861AbYLSWdj (ORCPT ); Fri, 19 Dec 2008 17:33:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754002AbYLSWdV (ORCPT ); Fri, 19 Dec 2008 17:33:21 -0500 Received: from kandzendo.ru ([195.178.208.66]:49136 "EHLO tservice.net.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839AbYLSWdR (ORCPT ); Fri, 19 Dec 2008 17:33:17 -0500 Date: Sat, 20 Dec 2008 01:33:15 +0300 From: Evgeniy Polyakov To: Jeremy Fitzhardinge Cc: Vladislav Bolkhovitin , linux-scsi@vger.kernel.org, James Bottomley , Andrew Morton , FUJITA Tomonori , Mike Christie , Jeff Garzik , Boaz Harrosh , Linus Torvalds , linux-kernel@vger.kernel.org, scst-devel@lists.sourceforge.net, Bart Van Assche , "Nicholas A. Bellinger" , netdev@vger.kernel.org, Rusty Russell , Herbert Xu , David Miller Subject: Re: [PATCH][RFC 23/23]: Support for zero-copy TCP transmit of user space data Message-ID: <20081219223314.GA2736@ioremap.net> References: <494009D7.4020602@vlnb.net> <494012C4.7090304@vlnb.net> <494C0255.8010208@goop.org> <20081219220452.GB704@ioremap.net> <494C1E5E.7070809@goop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <494C1E5E.7070809@goop.org> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 19, 2008 at 02:21:18PM -0800, Jeremy Fitzhardinge (jeremy@goop.org) wrote: > >There maybe a problem though, if iscsi will run over xen network, but in > >this case xen may copy the data, or iscsi may do that after determining > >that underlying network device does not allow shared info destructor > >(vis device/route flag for example). > > > > Xen only needs the callback in the case of traffic originating in > another Xen domain. If iscsi is involved, it will be running in the > other domain, and so all its callbacks and so on will happen there. > There's no conflict. That's good news. > >>Wouldn't you only need to do the lookup on the last put? > >> > >>An external lookup table might well for for us, if the net_put_page() > >>change is acceptable to the network folk. > >> > > > >That sounds like the best solution for this problem. > > > > An external lookup would just need to change put_page -> net_put_page, I > think. It is not needed I think, having skb shared info destructor has access to the all pages in that skb. > >David, will you accept shared info destructor? > > > > I'm not very familiar with the network stack, but am I right in assuming > that the shared_info destructor would be called when the network stack > has finished with all the pages it refers to? And those pages could be > the combination of pages separately submitted in different skbs? Shared info is freed when there are no skbs referring to the shared info in question. Skb holds all pages in shared info in the fraglist array, so when it is about to be freed, it means that network stack does not use it (particulary it will putpage every page in fraglist). Usually there are two skbs in the network stack per packet in TCP (allocated at once though via fastclone mechanims): one is provided to the device (and will be freed there) and another one is placed into retransmit queue, where it will be located and freed when ack has been received. There may be another layers which may clone skb, but its shared info structure (shared between the clones) will only be freed when all users freed appropriate cloned skbs. -- Evgeniy Polyakov