Print this page
XXXX pass in cpu_pause_func via pause_cpus


1463         int             i;
1464         lgrp_t          *lgrp;
1465 
1466         count = 0;
1467         if (changed)
1468                 klgrpset_clear(*changed);
1469 
1470         /*
1471          * For UMA machines, make sure that root lgroup contains all
1472          * resources.  The root lgrp should also name itself as its own leaf
1473          */
1474         if (nlgrps == 1) {
1475                 for (i = 0; i < LGRP_RSRC_COUNT; i++)
1476                         klgrpset_add(lgrp_root->lgrp_set[i],
1477                             lgrp_root->lgrp_id);
1478                 klgrpset_add(lgrp_root->lgrp_leaves, lgrp_root->lgrp_id);
1479                 return (0);
1480         }
1481 
1482         mutex_enter(&cpu_lock);
1483         pause_cpus(NULL);
1484 
1485         /*
1486          * Look for any leaf lgroup without its latency set, finish adding it
1487          * to the lgroup topology assuming that it exists and has the root
1488          * lgroup as its parent, and update the memory nodes of all lgroups
1489          * that have it as a memory resource.
1490          */
1491         for (i = 0; i < lgrp_count; i++) {
1492                 lgrp = lgrps[i];
1493 
1494                 /*
1495                  * Skip non-existent and non-leaf lgroups and any lgroup
1496                  * with its latency set already
1497                  */
1498                 if (lgrp == NULL || lgrp->lgrp_id == LGRP_NONE ||
1499                     lgrp->lgrp_childcnt != 0 || lgrp->lgrp_latency != 0)
1500                         continue;
1501 
1502 #ifdef  DEBUG
1503                 if (lgrp_topo_debug > 1) {




1463         int             i;
1464         lgrp_t          *lgrp;
1465 
1466         count = 0;
1467         if (changed)
1468                 klgrpset_clear(*changed);
1469 
1470         /*
1471          * For UMA machines, make sure that root lgroup contains all
1472          * resources.  The root lgrp should also name itself as its own leaf
1473          */
1474         if (nlgrps == 1) {
1475                 for (i = 0; i < LGRP_RSRC_COUNT; i++)
1476                         klgrpset_add(lgrp_root->lgrp_set[i],
1477                             lgrp_root->lgrp_id);
1478                 klgrpset_add(lgrp_root->lgrp_leaves, lgrp_root->lgrp_id);
1479                 return (0);
1480         }
1481 
1482         mutex_enter(&cpu_lock);
1483         pause_cpus(NULL, NULL);
1484 
1485         /*
1486          * Look for any leaf lgroup without its latency set, finish adding it
1487          * to the lgroup topology assuming that it exists and has the root
1488          * lgroup as its parent, and update the memory nodes of all lgroups
1489          * that have it as a memory resource.
1490          */
1491         for (i = 0; i < lgrp_count; i++) {
1492                 lgrp = lgrps[i];
1493 
1494                 /*
1495                  * Skip non-existent and non-leaf lgroups and any lgroup
1496                  * with its latency set already
1497                  */
1498                 if (lgrp == NULL || lgrp->lgrp_id == LGRP_NONE ||
1499                     lgrp->lgrp_childcnt != 0 || lgrp->lgrp_latency != 0)
1500                         continue;
1501 
1502 #ifdef  DEBUG
1503                 if (lgrp_topo_debug > 1) {