summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-07-20 12:13:08 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2017-07-20 12:13:08 +0000
commit2cc9c5986039d6f3f44698ab21f5fcd2edc6202e (patch)
tree21f57cdc0f78dc1894e86c3215bc6e953cf29a37
parent2bcd0c2213ad2567e05837f2b5406447e005a44b (diff)
parent267ae6c3a88d2fc39276af66caafa978b0935b82 (diff)
downloadillumos-joyent-2cc9c5986039d6f3f44698ab21f5fcd2edc6202e.tar.gz
[illumos-gate merge]
commit 267ae6c3a88d2fc39276af66caafa978b0935b82 7915 checks in l2arc_evict could use some cleaning up commit 73789e670fa73c1961b0449d97b3be10fe3c28ac 8496 Multiple cores per socket does not work on Cloudstack KVM setup
-rw-r--r--usr/src/uts/common/fs/zfs/arc.c24
-rw-r--r--usr/src/uts/i86pc/io/mp_platform_common.c36
2 files changed, 41 insertions, 19 deletions
diff --git a/usr/src/uts/common/fs/zfs/arc.c b/usr/src/uts/common/fs/zfs/arc.c
index 92c8b13581..e0a29f40e0 100644
--- a/usr/src/uts/common/fs/zfs/arc.c
+++ b/usr/src/uts/common/fs/zfs/arc.c
@@ -6764,18 +6764,16 @@ top:
goto top;
}
- if (HDR_L2_WRITE_HEAD(hdr)) {
- /*
- * We hit a write head node. Leave it for
- * l2arc_write_done().
- */
- list_remove(buflist, hdr);
- mutex_exit(hash_lock);
- continue;
- }
+ /*
+ * A header can't be on this list if it doesn't have L2 header.
+ */
+ ASSERT(HDR_HAS_L2HDR(hdr));
- if (!all && HDR_HAS_L2HDR(hdr) &&
- (hdr->b_l2hdr.b_daddr > taddr ||
+ /* Ensure this header has finished being written. */
+ ASSERT(!HDR_L2_WRITING(hdr));
+ ASSERT(!HDR_L2_WRITE_HEAD(hdr));
+
+ if (!all && (hdr->b_l2hdr.b_daddr >= taddr ||
hdr->b_l2hdr.b_daddr < dev->l2ad_hand)) {
/*
* We've evicted to the target address,
@@ -6785,7 +6783,6 @@ top:
break;
}
- ASSERT(HDR_HAS_L2HDR(hdr));
if (!HDR_HAS_L1HDR(hdr)) {
ASSERT(!HDR_L2_READING(hdr));
/*
@@ -6808,9 +6805,6 @@ top:
arc_hdr_set_flags(hdr, ARC_FLAG_L2_EVICTED);
}
- /* Ensure this header has finished being written */
- ASSERT(!HDR_L2_WRITING(hdr));
-
arc_hdr_l2hdr_destroy(hdr);
}
mutex_exit(hash_lock);
diff --git a/usr/src/uts/i86pc/io/mp_platform_common.c b/usr/src/uts/i86pc/io/mp_platform_common.c
index 373fb97225..9d23d383ab 100644
--- a/usr/src/uts/i86pc/io/mp_platform_common.c
+++ b/usr/src/uts/i86pc/io/mp_platform_common.c
@@ -22,6 +22,7 @@
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2016 Nexenta Systems, Inc.
* Copyright 2017 Joyent, Inc.
+ * Copyright (c) 2017 by Delphix. All rights reserved.
*/
/*
* Copyright (c) 2010, Intel Corporation.
@@ -287,6 +288,8 @@ static int acpi_nmi_scnt = 0;
static ACPI_MADT_LOCAL_APIC_NMI *acpi_nmi_cp = NULL;
static int acpi_nmi_ccnt = 0;
+static boolean_t acpi_found_smp_config = B_FALSE;
+
/*
* The following added to identify a software poweroff method if available.
*/
@@ -612,8 +615,10 @@ acpi_probe(char *modname)
return (PSM_FAILURE);
if (AcpiGetTable(ACPI_SIG_MADT, 1,
- (ACPI_TABLE_HEADER **) &acpi_mapic_dtp) != AE_OK)
+ (ACPI_TABLE_HEADER **) &acpi_mapic_dtp) != AE_OK) {
+ cmn_err(CE_WARN, "!acpi_probe: No MADT found!");
return (PSM_FAILURE);
+ }
apicadr = mapin_apic((uint32_t)acpi_mapic_dtp->Address,
APIC_LOCAL_MEMLEN, PROT_READ | PROT_WRITE);
@@ -817,6 +822,13 @@ acpi_probe(char *modname)
ap = (ACPI_SUBTABLE_HEADER *)(((char *)ap) + ap->Length);
}
+ /* We found multiple enabled cpus via MADT */
+ if ((apic_nproc > 1) && (apic_io_max > 0)) {
+ acpi_found_smp_config = B_TRUE;
+ cmn_err(CE_NOTE,
+ "!apic: Using ACPI (MADT) for SMP configuration");
+ }
+
/*
* allocate enough space for possible hot-adding of CPUs.
* max_ncpus may be less than apic_nproc if it's set by user.
@@ -923,8 +935,10 @@ acpi_probe(char *modname)
* If this fails, we don't attempt to use ACPI
* even if we were able to get a MADT above
*/
- if (acpica_init() != AE_OK)
+ if (acpica_init() != AE_OK) {
+ cmn_err(CE_WARN, "!apic: Failed to initialize acpica!");
goto cleanup;
+ }
/*
* Call acpica_build_processor_map() now that we have
@@ -953,6 +967,7 @@ acpi_probe(char *modname)
/* Enable ACPI APIC interrupt routing */
if (apic_acpi_enter_apicmode() != PSM_FAILURE) {
+ cmn_err(CE_NOTE, "!apic: Using APIC interrupt routing mode");
build_reserved_irqlist((uchar_t *)apic_reserved_irqlist);
apic_enable_acpi = 1;
if (apic_sci_vect > 0) {
@@ -980,6 +995,8 @@ acpi_probe(char *modname)
/* if setting APIC mode failed above, we fall through to cleanup */
cleanup:
+ cmn_err(CE_WARN, "!apic: Failed acpi_probe, SMP config was %s",
+ acpi_found_smp_config ? "found" : "not found");
apic_free_apic_cpus();
if (apicadr != NULL) {
mapout_apic((caddr_t)apicadr, APIC_LOCAL_MEMLEN);
@@ -998,6 +1015,7 @@ cleanup:
acpi_nmi_scnt = 0;
acpi_nmi_cp = NULL;
acpi_nmi_ccnt = 0;
+ acpi_found_smp_config = B_FALSE;
kmem_free(local_ids, NCPU * sizeof (uint32_t));
kmem_free(proc_ids, NCPU * sizeof (uint32_t));
return (PSM_FAILURE);
@@ -2264,10 +2282,20 @@ apic_acpi_enter_apicmode(void)
arg.Integer.Value = ACPI_APIC_MODE;
status = AcpiEvaluateObject(NULL, "\\_PIC", &arglist, NULL);
- if (ACPI_FAILURE(status))
+ /*
+ * Per ACPI spec - section 5.8.1 _PIC Method
+ * calling the \_PIC control method is optional for the OS
+ * and might not be found. It's ok to not fail in such cases.
+ * This is the case on linux KVM and qemu (status AE_NOT_FOUND)
+ */
+ if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
+ cmn_err(CE_NOTE,
+ "!apic: Reporting APIC mode failed (via _PIC), err: 0x%x",
+ ACPI_FAILURE(status));
return (PSM_FAILURE);
- else
+ } else {
return (PSM_SUCCESS);
+ }
}