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

[Xen-devel] per_cpu problem

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] per_cpu problem
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Date: Tue, 29 Dec 2009 13:45:55 +0100
Delivery-date: Tue, 29 Dec 2009 04:46:23 -0800
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=juergen.gross@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1262090711; x=1293626711; h=from:sender:reply-to:subject:date:message-id:to:cc: mime-version:content-transfer-encoding:content-id: content-description:resent-date:resent-from:resent-sender: resent-to:resent-cc:resent-message-id:in-reply-to: references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; z=From:=20Juergen=20Gross=20<juergen.gross@xxxxxxxxxxxxxx> |Subject:=20per_cpu=20problem|Date:=20Tue,=2029=20Dec=202 009=2013:45:55=20+0100|Message-ID:=20<4B39FA03.4010705@ts .fujitsu.com>|To:=20"xen-devel@xxxxxxxxxxxxxxxxxxx"=20<xe n-devel@xxxxxxxxxxxxxxxxxxx>|MIME-Version:=201.0 |Content-Transfer-Encoding:=207bit; bh=Tc5q/8ymp/kxYOsf/CnzSAqW0ymAGf0dpSDaoy5lV2M=; b=IS0G9M02YaacnNFKKykcKaqM/DX68WVwFHA5FTCrO25Nl3OhK9y6taYm Zp2QprmZXWt3ZO7qizG86iwrh7PJMbLTGYtjRVpMjXREqmK6aGjpIoEOT PHIjPfqEu90qzroqznRBYwhBGd03k62vi051HHjbP43YsgMQ2WWfWin8u flW+UtDb1pQOLHFcdYLjqq3YdC9dpUKoCa5STH17JpTCDRwHNdJVum4DN CkgmFF2BKp0dTPE340llLihMVGwXe;
Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:Subject:X-Enigmail-Version: Content-Type:Content-Transfer-Encoding; b=uiN+rsvPkkuqwVl1t6XTY6BBUvJhG2svv2b2+jXkiEPuoPVWTNwPmvv1 1UK2tgiPDstZiIyNwvwzRYRv6U1A4HaEkxODJo7em8L8Ti2mCdnbqxyYu GvBTxBFLLZ5X4tsRqbtSRXoEfZLjuaM1qmLXmn933WJEv1IxuB6lypvBz ZzxLBwLHfCGWUb7A4otVbTopftWEY0sAfEdAyqoT3oG+ohc58C5XpjyTr Sw9svnsUvEFXf9PQYPzGxgX9Ry08H;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Organization: Fujitsu Technology Solutions
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)
Hi,

I've been playing a little bit with cpu-bound tasklets. For this purpose I
defined a per_cpu list:

static DEFINE_PER_CPU(struct list_head, tasklet_list_pcpu);

The initialization is done in softirq_init:

void __init softirq_init(void)
{
    int i;

    for_each_possible_cpu ( i )
    {
        INIT_LIST_HEAD(&per_cpu(tasklet_list_pcpu, i));
    }
    tasklet_pcpu_inited = 1;
    open_softirq(TASKLET_SOFTIRQ, tasklet_action);
}

As soon as a cpu other than cpu 0 is accessing its tasklet_list_pcpu it is
seeing a non-empty list (I've put a printk in tasklet_action):

printk("tasklet_list_pcpu(%d) at %p not empty: %p\n", smp_processor_id(),
       &this_cpu(tasklet_list_pcpu), this_cpu(tasklet_list_pcpu).next);

Prints out:
(XEN) tasklet_list_pcpu(1) at ffff82c48026a100 not empty: ffff82c480268100

Somehow INIT_LIST_HEAD seems to put always the address of the list for cpu 0
in the list header. Could this be a compiler bug? Is this an artefact of the
per_cpu macro? Am I missing something?


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technolgy Solutions               e-mail: juergen.gross@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

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

<Prev in Thread] Current Thread [Next in Thread>