Print this page
9695 Slow crash dumps, significantly slower than live core
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/sata/adapters/ahci/ahci.c
          +++ new/usr/src/uts/common/io/sata/adapters/ahci/ahci.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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  /*
  23   23   * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  25   25   */
  26   26  
  27   27  /*
  28   28   * AHCI (Advanced Host Controller Interface) SATA HBA Driver
  29   29   *
  30   30   * Power Management Support
  31   31   * ------------------------
  32   32   *
  33   33   * At the moment, the ahci driver only implements suspend/resume to
  34   34   * support Suspend to RAM on X86 feature. Device power management isn't
↓ open down ↓ 1101 lines elided ↑ open up ↑
1136 1136                  return (DDI_FAILURE);
1137 1137          }
1138 1138  }
1139 1139  
1140 1140  /*
1141 1141   * The info entry point for dev_ops.
1142 1142   *
1143 1143   */
1144 1144  static int
1145 1145  ahci_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd,
1146      -                    void *arg, void **result)
     1146 +    void *arg, void **result)
1147 1147  {
1148 1148  #ifndef __lock_lint
1149 1149          _NOTE(ARGUNUSED(dip))
1150 1150  #endif /* __lock_lint */
1151 1151  
1152 1152          ahci_ctl_t *ahci_ctlp;
1153 1153          int instance;
1154 1154          dev_t dev;
1155 1155  
1156 1156          dev = (dev_t)arg;
↓ open down ↓ 651 lines elided ↑ open up ↑
1808 1808                  if ((rval = ahci_deliver_satapkt(ahci_ctlp, ahci_portp,
1809 1809                      addrp, spkt)) == AHCI_FAILURE) {
1810 1810                          ahci_portp->ahciport_flags &= ~AHCI_PORT_FLAG_POLLING;
1811 1811                          return (rval);
1812 1812                  }
1813 1813  
1814 1814                  pkt_timeout_ticks =
1815 1815                      drv_usectohz((clock_t)spkt->satapkt_time * 1000000);
1816 1816  
1817 1817                  while (spkt->satapkt_reason == SATA_PKT_BUSY) {
1818      -                        mutex_exit(&ahci_portp->ahciport_mutex);
1819      -
1820 1818                          /* Simulate the interrupt */
     1819 +                        mutex_exit(&ahci_portp->ahciport_mutex);
1821 1820                          ahci_port_intr(ahci_ctlp, ahci_portp, port);
     1821 +                        mutex_enter(&ahci_portp->ahciport_mutex);
1822 1822  
1823      -                        drv_usecwait(AHCI_10MS_USECS);
     1823 +                        if (spkt->satapkt_reason != SATA_PKT_BUSY)
     1824 +                                break;
1824 1825  
     1826 +                        mutex_exit(&ahci_portp->ahciport_mutex);
     1827 +                        drv_usecwait(AHCI_1MS_USECS);
1825 1828                          mutex_enter(&ahci_portp->ahciport_mutex);
1826      -                        pkt_timeout_ticks -= AHCI_10MS_TICKS;
     1829 +
     1830 +                        pkt_timeout_ticks -= AHCI_1MS_TICKS;
1827 1831                          if (pkt_timeout_ticks < 0) {
1828 1832                                  cmn_err(CE_WARN, "!ahci%d: ahci_do_sync_start "
1829 1833                                      "port %d satapkt 0x%p timed out\n",
1830 1834                                      instance, port, (void *)spkt);
1831 1835                                  timeout_tags = (0x1 << rval);
1832 1836                                  mutex_exit(&ahci_portp->ahciport_mutex);
1833 1837                                  ahci_timeout_pkts(ahci_ctlp, ahci_portp,
1834 1838                                      port, timeout_tags);
1835 1839                                  mutex_enter(&ahci_portp->ahciport_mutex);
1836 1840                          }
1837 1841                  }
     1842 +
1838 1843                  ahci_portp->ahciport_flags &= ~AHCI_PORT_FLAG_POLLING;
1839 1844                  return (AHCI_SUCCESS);
1840 1845  
1841 1846          } else {
1842 1847                  if ((rval = ahci_deliver_satapkt(ahci_ctlp, ahci_portp,
1843 1848                      addrp, spkt)) == AHCI_FAILURE)
1844 1849                          return (rval);
1845 1850  
1846 1851  #if AHCI_DEBUG
1847 1852                  /*
↓ open down ↓ 8477 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX