WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel][PV-ops][PATCH] Netback: Fix PV network issue for netback

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel][PV-ops][PATCH] Netback: Fix PV network issue for netback multiple threads patchset
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Thu, 01 Jul 2010 17:29:07 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Fantu <fantonifabio@xxxxxxxxxx>, "Xu, Dongxiao" <dongxiao.xu@xxxxxxxxx>, Paul Durrant <paul.durrant@xxxxxxxxxx>, djmagee@xxxxxxxxxxxx
Delivery-date: Thu, 01 Jul 2010 08:30:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1277995730.28432.24.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <D5AB6E638E5A3E4B8F4406B113A5A19A1F205536@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <1276248930.19091.2870.camel@xxxxxxxxxxxxxxxxxxxxxx> <D5AB6E638E5A3E4B8F4406B113A5A19A1F372F07@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4C1F49B1.3060403@xxxxxxxx> <1277995730.28432.24.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Lightning/1.0b2pre Thunderbird/3.0.4
On 07/01/2010 04:48 PM, Ian Campbell wrote:
> On Mon, 2010-06-21 at 12:14 +0100, Jeremy Fitzhardinge wrote:
>   
>> Subject: [PATCH] xen/netback: make sure all the group structures are 
>> initialized before starting async code
>>
>> Split the netbk group array initialization into two phases: one to do
>> simple "can't fail" initialization of lists, timers, locks, etc; and a
>> second pass to allocate memory and start the async code.
>>
>> This makes sure that all the basic stuff is in place by the time the async 
>> code
>> is running.
>>     
> Paul noticed a crash in netback init because...
>
>   
>> @@ -1764,16 +1766,6 @@ static int __init netback_init(void)
>>              netbk->netbk_tx_pending_timer.function =
>>                      netbk_tx_pending_timeout;
>>  
>> -            netbk->mmap_pages =
>> -                    alloc_empty_pages_and_pagevec(MAX_PENDING_REQS);
>> -            if (!netbk->mmap_pages) {
>> -                    printk(KERN_ALERT "%s: out of memory\n", __func__);
>> -                    del_timer(&netbk->netbk_tx_pending_timer);
>> -                    del_timer(&netbk->net_timer);
>> -                    rc = -ENOMEM;
>> -                    goto failed_init;
>> -            }
>> -
>>              for (i = 0; i < MAX_PENDING_REQS; i++) {
>>                      page = netbk->mmap_pages[i];
>>                      SetPageForeign(page, netif_page_release);
>>     
> ...this dereference of netbk->mmap_pages[i]...
>
>   
>> @@ -1786,6 +1778,26 @@ static int __init netback_init(void)
>>     
> [...]
>   
>> +            netbk->mmap_pages =
>> +                    alloc_empty_pages_and_pagevec(MAX_PENDING_REQS);
>>     
> ... happens before this initialisation of the array.
>   

Hm, I hadn't meant to commit that properly.  I had it locally and
accidentally pushed it out.

I only did that patch as an RFC in response to an issue alluded to by
Dongxiao (or was it you?) about things not being fully initialized by
the time the async code starts.  Is this a real issue, and if so, what's
the correct fix?

Thanks,
    J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel