Print this page
6854 Set but not used in hat_sfmmu.c

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sfmmu/vm/hat_sfmmu.c
          +++ new/usr/src/uts/sfmmu/vm/hat_sfmmu.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  /*
  25   25   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
       26 + * Copyright 2016 Gary Mills
  26   27   */
  27   28  
  28   29  /*
  29   30   * VM - Hardware Address Translation management for Spitfire MMU.
  30   31   *
  31   32   * This file implements the machine specific hardware translation
  32   33   * needed by the VM system.  The machine independent interface is
  33   34   * described in <vm/hat.h> while the machine dependent interface
  34   35   * and data structures are described in <vm/hat_sfmmu.h>.
  35   36   *
↓ open down ↓ 8147 lines elided ↑ open up ↑
8183 8184  void
8184 8185  hat_page_demote(page_t *pp)
8185 8186  {
8186 8187          int index;
8187 8188          int sz;
8188 8189          cpuset_t cpuset;
8189 8190          int sync = 0;
8190 8191          page_t *rootpp;
8191 8192          struct sf_hment *sfhme;
8192 8193          struct sf_hment *tmphme = NULL;
8193      -        struct hme_blk *hmeblkp;
8194 8194          uint_t pszc;
8195 8195          page_t *lastpp;
8196 8196          cpuset_t tset;
8197 8197          pgcnt_t npgs;
8198 8198          kmutex_t *pml;
8199 8199          kmutex_t *pmtx = NULL;
8200 8200  
8201 8201          ASSERT(PAGE_EXCL(pp));
8202 8202          ASSERT(!PP_ISFREE(pp));
8203 8203          ASSERT(!PP_ISKAS(pp));
↓ open down ↓ 17 lines elided ↑ open up ↑
8221 8221                  if (!(index & 0x1)) {
8222 8222                          index >>= 1;
8223 8223                          sz++;
8224 8224                          continue;
8225 8225                  }
8226 8226                  ASSERT(sz <= pszc);
8227 8227                  rootpp = PP_GROUPLEADER(pp, sz);
8228 8228                  for (sfhme = rootpp->p_mapping; sfhme; sfhme = tmphme) {
8229 8229                          tmphme = sfhme->hme_next;
8230 8230                          ASSERT(!IS_PAHME(sfhme));
8231      -                        hmeblkp = sfmmu_hmetohblk(sfhme);
8232 8231                          if (hme_size(sfhme) != sz) {
8233 8232                                  continue;
8234 8233                          }
8235 8234                          tset = sfmmu_pageunload(rootpp, sfhme, sz);
8236 8235                          CPUSET_OR(cpuset, tset);
8237 8236                  }
8238 8237                  if (index >>= 1) {
8239 8238                          sz++;
8240 8239                  }
8241 8240          }
↓ open down ↓ 4987 lines elided ↑ open up ↑
13229 13228   * Searchs the mapping list of the page for a mapping of the same size. If not
13230 13229   * found the corresponding bit is cleared in the p_index field. When large
13231 13230   * pages are more prevalent in the system, we can maintain the mapping list
13232 13231   * in order and we don't have to traverse the list each time. Just check the
13233 13232   * next and prev entries, and if both are of different size, we clear the bit.
13234 13233   */
13235 13234  static void
13236 13235  sfmmu_rm_large_mappings(page_t *pp, int ttesz)
13237 13236  {
13238 13237          struct sf_hment *sfhmep;
13239      -        struct hme_blk *hmeblkp;
13240 13238          int     index;
13241 13239          pgcnt_t npgs;
13242 13240  
13243 13241          ASSERT(ttesz > TTE8K);
13244 13242  
13245 13243          ASSERT(sfmmu_mlist_held(pp));
13246 13244  
13247 13245          ASSERT(PP_ISMAPPED_LARGE(pp));
13248 13246  
13249 13247          /*
13250 13248           * Traverse mapping list looking for another mapping of same size.
13251 13249           * since we only want to clear index field if all mappings of
13252 13250           * that size are gone.
13253 13251           */
13254 13252  
13255 13253          for (sfhmep = pp->p_mapping; sfhmep; sfhmep = sfhmep->hme_next) {
13256 13254                  if (IS_PAHME(sfhmep))
13257 13255                          continue;
13258      -                hmeblkp = sfmmu_hmetohblk(sfhmep);
13259 13256                  if (hme_size(sfhmep) == ttesz) {
13260 13257                          /*
13261 13258                           * another mapping of the same size. don't clear index.
13262 13259                           */
13263 13260                          return;
13264 13261                  }
13265 13262          }
13266 13263  
13267 13264          /*
13268 13265           * Clear the p_index bit for large page.
↓ open down ↓ 2389 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX