/* * printk() is not safe in MCE context. This is a lock-less memory allocator * used to save error information organized in a lock-less list. * * This memory pool is only to be used to save MCE records in MCE context. * MCE events are rare, so a fixed size memory pool should be enough. * Allocate on a sliding scale based on number of CPUs.
*/ #define MCE_MIN_ENTRIES 80 #define MCE_PER_CPU 2
/* * Compare the record "t" with each of the records on list "l" to see if * an equivalent one is present in the list.
*/ staticbool is_duplicate_mce_record(struct mce_evt_llist *t, struct mce_evt_llist *l)
{ struct mce_hw_err *err1, *err2; struct mce_evt_llist *node;
if (!mce_cmp(&err1->m, &err2->m)) returntrue;
} returnfalse;
}
/* * The system has panicked - we'd like to peruse the list of MCE records * that have been queued, but not seen by anyone yet. The list is in * reverse time order, so we need to reverse it. While doing that we can * also drop duplicate records (these were logged because some banks are * shared between cores or by all threads on a socket).
*/ struct llist_node *mce_gen_pool_prepare_records(void)
{ struct llist_node *head;
LLIST_HEAD(new_head); struct mce_evt_llist *node, *t;
head = llist_del_all(&mce_event_llist); if (!head) return NULL;
/* squeeze out duplicates while reversing order */
llist_for_each_entry_safe(node, t, head, llnode) { if (!is_duplicate_mce_record(node, t))
llist_add(&node->llnode, &new_head);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.