Print this page
XXXX remove i86xpv platform code
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/genunix/memory.c
          +++ new/usr/src/cmd/mdb/common/modules/genunix/memory.c
↓ open down ↓ 33 lines elided ↑ open up ↑
  34   34  #include <vm/anon.h>
  35   35  #include <vm/as.h>
  36   36  #include <vm/page.h>
  37   37  #include <sys/thread.h>
  38   38  #include <sys/swap.h>
  39   39  #include <sys/memlist.h>
  40   40  #include <sys/vnode.h>
  41   41  #include <vm/seg_map.h>
  42   42  #include <vm/seg_vn.h>
  43   43  #include <vm/seg_hole.h>
  44      -#if defined(__i386) || defined(__amd64)
  45      -#include <sys/balloon_impl.h>
  46      -#endif
  47   44  
  48   45  #include "avl.h"
  49   46  #include "memory.h"
  50   47  
  51   48  /*
  52   49   * Page walker.
  53   50   * By default, this will walk all pages in the system.  If given an
  54   51   * address, it will walk all pages belonging to the vnode at that
  55   52   * address.
  56   53   */
↓ open down ↓ 445 lines elided ↑ open up ↑
 502  499  int
 503  500  memstat(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 504  501  {
 505  502          pgcnt_t total_pages, physmem;
 506  503          ulong_t freemem;
 507  504          memstat_t stats;
 508  505          GElf_Sym sym;
 509  506          vn_htable_t ht;
 510  507          struct vnode *kvps;
 511  508          uintptr_t vn_size = 0;
 512      -#if defined(__i386) || defined(__amd64)
 513      -        bln_stats_t bln_stats;
 514      -        ssize_t bln_size;
 515      -#endif
 516  509  
 517  510          bzero(&stats, sizeof (memstat_t));
 518  511  
 519  512          /*
 520  513           * -s size, is an internal option. It specifies the size of vn_htable.
 521  514           * Hash table size is set in the following order:
 522  515           * If user has specified the size that is larger than VN_LARGE: try it,
 523  516           * but if malloc failed default to VN_SMALL. Otherwise try VN_LARGE, if
 524  517           * failed to allocate default to VN_SMALL.
 525  518           * For a better efficiency of hash table it is highly recommended to
↓ open down ↓ 98 lines elided ↑ open up ↑
 624  617  
 625  618          /*
 626  619           * occasionally, we double count pages above.  To avoid printing
 627  620           * absurdly large values for freemem, we clamp it at zero.
 628  621           */
 629  622          if (physmem > stats.ms_total)
 630  623                  freemem = physmem - stats.ms_total;
 631  624          else
 632  625                  freemem = 0;
 633  626  
 634      -#if defined(__i386) || defined(__amd64)
 635      -        /* Are we running under Xen?  If so, get balloon memory usage. */
 636      -        if ((bln_size = mdb_readvar(&bln_stats, "bln_stats")) != -1) {
 637      -                if (freemem > bln_stats.bln_hv_pages)
 638      -                        freemem -= bln_stats.bln_hv_pages;
 639      -                else
 640      -                        freemem = 0;
 641      -        }
 642      -#endif
 643      -
 644  627          mdb_printf("Free (freelist)  %16lu  %16llu  %3lu%%\n", freemem,
 645  628              (uint64_t)freemem * PAGESIZE / (1024 * 1024),
 646  629              MS_PCT_TOTAL(freemem));
 647  630  
 648      -#if defined(__i386) || defined(__amd64)
 649      -        if (bln_size != -1) {
 650      -                mdb_printf("Balloon          %16lu  %16llu  %3lu%%\n",
 651      -                    bln_stats.bln_hv_pages,
 652      -                    (uint64_t)bln_stats.bln_hv_pages * PAGESIZE / (1024 * 1024),
 653      -                    MS_PCT_TOTAL(bln_stats.bln_hv_pages));
 654      -        }
 655      -#endif
 656      -
 657  631          mdb_printf("\nTotal            %16lu  %16lu\n",
 658  632              physmem,
 659  633              (uint64_t)physmem * PAGESIZE / (1024 * 1024));
 660  634  
 661  635          if (physmem != total_pages) {
 662  636                  mdb_printf("Physical         %16lu  %16lu\n",
 663  637                      total_pages,
 664  638                      (uint64_t)total_pages * PAGESIZE / (1024 * 1024));
 665  639          }
 666  640  
↓ open down ↓ 1045 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX