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-ia64-devel

Re: [Xen-ia64-devel] Re: [PATCH]: ptc.ga for SMP-g

To: "Tian, Kevin" <kevin.tian@xxxxxxxxx>, "Isaku Yamahata" <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] Re: [PATCH]: ptc.ga for SMP-g
From: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Date: Thu, 30 Mar 2006 09:56:01 +0100
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 30 Mar 2006 08:53:28 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <571ACEFD467F7749BC50E0A98C17CDD8094E7A36@pdsmsx403>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <571ACEFD467F7749BC50E0A98C17CDD8094E7A36@pdsmsx403>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.5
Le Jeudi 30 Mars 2006 10:42, Tian, Kevin a écrit :
> From: Tristan Gingold
>
> >Sent: 2006年3月30日 16:31
> >
> >Le Mardi 28 Mars 2006 04:04, Isaku Yamahata a écrit :
> >> Hi Tristan.
> >>
> >>
> >> +                  /* Purge tc entry.
> >> +                     Can we do this directly ?  Well, this is just a
> >> +                     single atomic write.  */
> >> +                  vcpu_purge_tr_entry(&PSCBX(v,dtlb));
> >> +                  vcpu_purge_tr_entry(&PSCBX(v,itlb));
> >>
> >> These aren't SMP-safe because dtlb isn't read atomically.
> >> From vcpu_translate()
> >>
> >> #define vcpu_match_tr_entry(_trp,_ifa,_rid)             \
> >>     ((_trp->p && (_trp->rid==_rid) && (_ifa >= _trp->vadr) &&   \
> >>     (_ifa < (_trp->vadr + (1L<< _trp->ps)) - 1)))
> >>
> >>         trp = &vcpu->arch.dtlb;
> >>         if (/* is_data && */ vcpu_match_tr_entry(trp,address,rid)) {
> >>                 <<<<<<<<<<<<If other processor executes
> >>                             vcpu_purge_tr_entry(&PSCBX(v,dtlb))
> >
> >here,
> >
> >>                             then a disaster will happen
> >
> >Can you elaborate ? Do you have a disaster scenario ?
> >vcpu_purge_tr_entry only clears the p bit.
>
> I think it's not safe for one vcpu to operate date structure on another
> vcpu. For example, current vcpu is doing vcpu_match_tr_entry. Just after
> checking _trp->p, then another vcpu invokes vcpu_purge_tr_entry to clear
> _trp->p. In this case, vcpu_match_tr_entry should return false however it
> may return true based on old knowledge since the whole check is not atomic.
This is as if the purge was done a few cycles after the checks.

> The preferred way is to only purge entry on its own context by sending IPI.
> For example, you can put vcpu_purge_tr_entry into ptc_ga_remote_func
> which will execute in right vcpu owning that entry.
Ok for this scheme.

I think there are two methods:
* either doing all the work with IPI (purge and ptc.l)
* or doing all the work locally (writing into other vcpu and ptc.ga)

I don't know which one is the best.

The main problem with IPI is migration.  However, currently migration doesn't 
work well.  I think it is ok to migrate a vcpu from CPU X to CPU Y, but we 
don't support migrating back from CPU Y to CPU X.

Tristan.



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