Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rasdaemon: Add page offline support for cxl memory #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ras-cxl-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,12 @@ int ras_cxl_dram_event_handler(struct trace_seq *s,
if (trace_seq_printf(s, "dpa:0x%llx ", (unsigned long long)ev.dpa) <= 0)
return -1;

if (tep_get_field_val(s, event, "hpa", record, &val, 1) < 0)
return -1;
ev.hpa = val;
if (trace_seq_printf(s, "hpa:0x%llx ", (unsigned long long)ev.hpa) <= 0)
return -1;

if (tep_get_field_val(s, event, "dpa_flags", record, &val, 1) < 0)
return -1;
ev.dpa_flags = val;
Expand Down Expand Up @@ -1045,6 +1051,13 @@ int ras_cxl_dram_event_handler(struct trace_seq *s,
}
}

#ifdef HAVE_MEMORY_CE_PFA
/* Page offline for CE when threeshold is set */
if (!(ev.descriptor & CXL_GMER_EVT_DESC_UNCORECTABLE_EVENT) &&
(ev.descriptor & CXL_GMER_EVT_DESC_THRESHOLD_EVENT))
ras_hw_threshold_pageoffline(ev.hpa);
#endif

/* Insert data into the SGBD */
#ifdef HAVE_SQLITE3
ras_store_cxl_dram_event(ras, &ev);
Expand Down
7 changes: 7 additions & 0 deletions ras-page-isolation.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ void ras_record_page_error(unsigned long long addr, unsigned int count, time_t t
}
}

void ras_hw_threshold_pageoffline(unsigned long long addr)
{
time_t now = time(NULL);

ras_record_page_error(addr, threshold.val, now);
}

/* memory page CE threshold policy ends */

/* memory row CE threshold policy starts */
Expand Down
1 change: 1 addition & 0 deletions ras-page-isolation.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ struct isolation {
void ras_page_account_init(void);
void ras_record_page_error(unsigned long long addr,
unsigned int count, time_t time);
void ras_hw_threshold_pageoffline(unsigned long long addr);
void ras_row_account_init(void);
void ras_record_row_error(const char *detail, unsigned int count, time_t time,
unsigned long long addr);
Expand Down
1 change: 1 addition & 0 deletions ras-record.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ struct ras_cxl_general_media_event {
struct ras_cxl_dram_event {
struct ras_cxl_event_common_hdr hdr;
uint64_t dpa;
uint64_t hpa;
uint8_t dpa_flags;
uint8_t descriptor;
uint8_t type;
Expand Down