Index: trunk/kernel/kern/dqdt.c
===================================================================
--- trunk/kernel/kern/dqdt.c	(revision 583)
+++ trunk/kernel/kern/dqdt.c	(revision 632)
@@ -373,35 +373,39 @@
 // It traverses the quad tree from clusters to root.
 ///////////////////////////////////////////////////////////////////////////
-// @ node       : extended pointer on current node
+// @ node_xp    : extended pointer on current node
 // @ increment  : number of pages variation
 ///////////////////////////////////////////////////////////////////////////
-static void dqdt_propagate_pages( xptr_t  node,
+static void dqdt_propagate_pages( xptr_t  node_xp,
                                   int32_t increment )
 {
     // get current node cluster identifier and local pointer
-    cxy_t         cxy = GET_CXY( node );
-    dqdt_node_t * ptr = GET_PTR( node );
+    cxy_t         node_cxy = GET_CXY( node_xp );
+    dqdt_node_t * node_ptr = GET_PTR( node_xp );
 
     // update current node pages number
-    hal_remote_atomic_add( XPTR( cxy , &ptr->pages ) , increment );
+    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->pages ) , increment );
 
     // get extended pointer on parent node
-    xptr_t parent = (xptr_t)hal_remote_l64( XPTR( cxy , &ptr->parent ) );
+    xptr_t parent_xp = (xptr_t)hal_remote_l64( XPTR( node_cxy , &node_ptr->parent ) );
 
     // propagate if required
-    if ( parent != XPTR_NULL ) dqdt_propagate_pages( parent, increment );
-}
-
-///////////////////////////////////////////
-void dqdt_increment_pages( uint32_t order )
-{
-	cluster_t   * cluster = LOCAL_CLUSTER;
-    dqdt_node_t * node    = &cluster->dqdt_tbl[0];
-
-    // update DQDT node level 0
-    hal_atomic_add( &node->pages , (1 << order) );
-
-    // propagate to DQDT upper levels
-    if( node->parent != XPTR_NULL ) dqdt_propagate_pages( node->parent , (1 << order) );
+    if ( parent_xp != XPTR_NULL ) dqdt_propagate_pages( parent_xp, increment );
+}
+
+////////////////////////////////////////
+void dqdt_increment_pages( cxy_t    cxy,
+                           uint32_t order )
+{
+    // get local pointer on node[0] (same in all clusters)
+    dqdt_node_t * node_ptr = &LOCAL_CLUSTER->dqdt_tbl[0];
+
+    // update DQDT node[0] in remote cluster cxy
+    hal_remote_atomic_add( XPTR( cxy , &node_ptr->pages ) , (1 << order) );
+
+    // get extended pointer on parent node in remote cluster cxy
+    xptr_t parent_xp = hal_remote_l64( XPTR( cxy , &node_ptr->parent ) );
+
+     // propagate to DQDT upper levels
+    if( parent_xp != XPTR_NULL ) dqdt_propagate_pages( parent_xp , (1 << order) );
 
 #if DEBUG_DQDT_UPDATE_PAGES
@@ -409,20 +413,25 @@
 if( cycle > DEBUG_DQDT_UPDATE_PAGES )
 printk("\n[DBG] %s : thread %x in process %x / %x pages in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, node->pages, local_cxy, cycle );
-#endif
-
-}
-
-///////////////////////////////////////////
-void dqdt_decrement_pages( uint32_t order )
-{
-	cluster_t   * cluster = LOCAL_CLUSTER;
-    dqdt_node_t * node    = &cluster->dqdt_tbl[0];
-
-    // update DQDT node level 0
-    hal_atomic_add( &node->pages , -(1 << order) );
-
-    // propagate to DQDT upper levels
-    if( node->parent != XPTR_NULL ) dqdt_propagate_pages( node->parent , -(1 << order) );
+__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid,
+hal_remote_l32( XPTR( cxy , &node_ptr->pages ), cxy, cycle );
+#endif
+
+}
+
+////////////////////////////////////////
+void dqdt_decrement_pages( cxy_t    cxy,
+                           uint32_t order )
+{
+    // get local pointer on node[0] (same in all clusters)
+    dqdt_node_t * node_ptr = &LOCAL_CLUSTER->dqdt_tbl[0];
+
+    // update DQDT node[0] in remote cluster cxy
+    hal_remote_atomic_add( XPTR( cxy , &node_ptr->pages ) , -(1 << order) );
+
+    // get extended pointer on parent node in remote cluster cxy
+    xptr_t parent_xp = hal_remote_l64( XPTR( cxy , &node_ptr->parent ) );
+
+     // propagate to DQDT upper levels
+    if( parent_xp != XPTR_NULL ) dqdt_propagate_pages( parent_xp , -(1 << order) );
 
 #if DEBUG_DQDT_UPDATE_PAGES
@@ -430,5 +439,6 @@
 if( cycle > DEBUG_DQDT_UPDATE_PAGES )
 printk("\n[DBG] %s : thread %x in process %x / %x pages in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, node->pages, local_cxy, cycle );
+__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid,
+hal_remote_l32( XPTR( cxy , &node_ptr->pages ), cxy, cycle );
 #endif
 
@@ -478,5 +488,6 @@
 if( cycle > DEBUG_DQDT_UPDATE_THREADS )
 printk("\n[DBG] %s : thread %x in process %x / %d threads in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, node->threads, local_cxy, cycle );
+__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 
+node->threads, local_cxy, cycle );
 #endif
 
@@ -499,5 +510,6 @@
 if( cycle > DEBUG_DQDT_UPDATE_THREADS )
 printk("\n[DBG] %s : thread %x in process %x / %d threads in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, node->threads, local_cxy, cycle );
+__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 
+node->threads, local_cxy, cycle );
 #endif
 
