mm, memory-failure: clarify error message
Subsystems (3)
PATCH 1/1 mm, memory-failure: clarify error message
Some user who install SIGBUS handler that does longjmp out therefore keeping the process alive is confused by the error message
"[188988.765862] Memory failure: 0x1840200: Killing
cellsrv:33395 due to hardware memory corruption"
Slightly modify the error message to improve clarity.
--- mm/memory-failure.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
mm/memory-failure.c +4 -3
@@ -216,10 +216,9 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)short addr_lsb = tk->size_shift;int ret; -pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n" , - pfn, t->comm, t->pid); -if ((flags &MF_ACTION_REQUIRED ) && t->mm == current->mm) { +pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory " +"corruption\n" , pfn, t->comm, t->pid); ret =force_sig_mceerr (BUS_MCEERR_AR , (void __user *)tk->addr, addr_lsb, current); }else {
@@ -229,6 +228,8 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)* This could cause a loop when the user sets SIGBUS * to SIG_IGN, but hopefully no one will do that? */ +pr_err ("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware " +"memory corruption\n" , pfn, t->comm, t->pid); ret =send_sig_mceerr (BUS_MCEERR_AO , (void __user *)tk->addr, addr_lsb, t);/* synchronous? */ }
Signature · 6 lines
1.8.3.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 1 line · Jane Chu
Some user who install SIGBUS handler that does longjmp out
What the longjmp about ? Are you referring to the mechanism of catching the signal which was registered ?
Quoted 4 lines
therefore keeping the process alive is confused by the error message
"[188988.765862] Memory failure:0x1840200: Killing
cellsrv:33395 due to hardware memory corruption"
Its a valid point because those are two distinct actions.
Quoted 25 lines
Slightly modify the error message to improve clarity.
Signed-off-by Jane Chu <[email protected]>--- mm/memory-failure.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)mm/memory-failure.c +2
-3@@ -216,10 +216,9 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)short addr_lsb = tk->size_shift;int ret; -pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n" , - pfn, t->comm, t->pid); -if ((flags &MF_ACTION_REQUIRED ) && t->mm == current->mm) { +pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory " +"corruption\n" , pfn, t->comm, t->pid); ret =force_sig_mceerr (BUS_MCEERR_AR , (void __user *)tk->addr, addr_lsb, current); }else {
mm/memory-failure.c static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) · line 234
Quoted 7 lines
mm/memory-failure.c +2
-0@@ -229,6 +228,8 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)* This could cause a loop when the user sets SIGBUS * to SIG_IGN, but hopefully no one will do that? */ +pr_err ("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware " +"memory corruption\n" , pfn, t->comm, t->pid); ret =send_sig_mceerr (BUS_MCEERR_AO , (void __user *)tk->addr, addr_lsb, t);/* synchronous? */
As both the pr_err() messages are very similar, could not we just switch between "Killing" and "Sending SIGBUS to" based on a variable e.g action_[kill|sigbus] evaluated previously with ((flags & MF_ACTION_REQUIRED) && t->mm == current->mm).
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 7 lines · Anshuman Khandual
Quoted 1 line · Jane Chu
Some user who install SIGBUS handler that does longjmp out
What the longjmp about ? Are you referring to the mechanism of catching the signal which was registered ?
AFAIK, longjmp() might be useful for signal-based retrying, so highly optimized applications like Oracle DB might want to utilize it to handle memory errors in application level, I guess.
Quoted 36 lines
Quoted 5 lines
therefore keeping the process alive is confused by the error message
"[188988.765862] Memory failure:0x1840200: Killing
cellsrv:33395 due to hardware memory corruption"Its a valid point because those are two distinct actions.
Quoted 28 lines
Slightly modify the error message to improve clarity.
Signed-off-by Jane Chu <[email protected]>--- mm/memory-failure.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)mm/memory-failure.c +2
-3@@ -216,10 +216,9 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)short addr_lsb = tk->size_shift;int ret; -pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n" , - pfn, t->comm, t->pid); -if ((flags &MF_ACTION_REQUIRED ) && t->mm == current->mm) { +pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory " +"corruption\n" , pfn, t->comm, t->pid); ret =force_sig_mceerr (BUS_MCEERR_AR , (void __user *)tk->addr, addr_lsb, current); }else {@@ -229,6 +228,8 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)* This could cause a loop when the user sets SIGBUS * to SIG_IGN, but hopefully no one will do that? */
Quoted 8 lines
mm/memory-failure.c static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) · line 234
Quoted 4 lines
mm/memory-failure.c +2
-0+pr_err ("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware " +"memory corruption\n" , pfn, t->comm, t->pid); ret =send_sig_mceerr (BUS_MCEERR_AO , (void __user *)tk->addr, addr_lsb, t);/* synchronous? */ As both the
pr_err()messages are very similar, could not we just switch between "Killing" and "Sending SIGBUS to" based on a variable e.g action_[kill|sigbus] evaluated previously with ((flags &MF_ACTION_REQUIRED) &&t->mm==current->mm).
That might need additional if sentence, which I'm not sure worth doing. I think that the simplest fix for the reported problem (a confusing message) is like below:
- pr_err("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n",
+ pr_err("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware memory corruption\n",
pfn, t->comm, t->pid);
Or, if we have a good reason to separate the message for MF_ACTION_REQUIRED and MF_ACTION_OPTIONAL, that might be OK.
Thanks,
Naoya Horiguchi
Thanks Vishal and Naoya!
-jane
Quoted 64 lines · Naoya Horiguchi
Quoted 5 lines · Anshuman Khandual
Quoted 1 line · Jane Chu
Some user who install SIGBUS handler that does longjmp out
What the longjmp about ? Are you referring to the mechanism of catching the signal which was registered ?
AFAIK,
longjmp()might be useful for signal-based retrying, so highly optimized applications like Oracle DB might want to utilize it to handle memory errors in application level, I guess.Quoted 33 lines
Quoted 4 lines
therefore keeping the process alive is confused by the error message
"[188988.765862] Memory failure:0x1840200: Killing
cellsrv:33395 due to hardware memory corruption"Its a valid point because those are two distinct actions.
Quoted 27 lines
Slightly modify the error message to improve clarity.
Signed-off-by Jane Chu <[email protected]>--- mm/memory-failure.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)mm/memory-failure.c +2
-3@@ -216,10 +216,9 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)short addr_lsb = tk->size_shift;int ret; -pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n" , - pfn, t->comm, t->pid); -if ((flags &MF_ACTION_REQUIRED ) && t->mm == current->mm) { +pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory " +"corruption\n" , pfn, t->comm, t->pid); ret =force_sig_mceerr (BUS_MCEERR_AR , (void __user *)tk->addr, addr_lsb, current); }else {@@ -229,6 +228,8 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)* This could cause a loop when the user sets SIGBUS * to SIG_IGN, but hopefully no one will do that? Quoted 8 lines
mm/memory-failure.c static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) · line 234
Quoted 5 lines
mm/memory-failure.c +2
-0*/ +pr_err ("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware " +"memory corruption\n" , pfn, t->comm, t->pid); ret =send_sig_mceerr (BUS_MCEERR_AO , (void __user *)tk->addr, addr_lsb, t);/* synchronous? */ As both the
pr_err()messages are very similar, could not we just switch between "Killing" and "Sending SIGBUS to" based on a variable e.g action_[kill|sigbus] evaluated previously with ((flags &MF_ACTION_REQUIRED) &&t->mm==current->mm).That might need additional if sentence, which I'm not sure worth doing. I think that the simplest fix for the reported problem (a confusing message) is like below:
- pr_err("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n",
+ pr_err("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware memory corruption\n",
pfn,t->comm,t->pid);Or, if we have a good reason to separate the message for
MF_ACTION_REQUIREDandMF_ACTION_OPTIONAL, that might be OK.Thanks,
Naoya Horiguchi
Quoted 4 lines · Anshuman Khandual
Quoted 1 line · Jane Chu
Some user who install SIGBUS handler that does longjmp out
What the longjmp about ? Are you referring to the mechanism of catching the signal which was registered ?
Yes.
thanks,
-jane
Verma, Vishal L
maintainerQuoted 17 lines · Jane Chu
Some user who install SIGBUS handler that does longjmp out therefore keeping the process alive is confused by the error message
"[188988.765862] Memory failure:0x1840200: Killing
cellsrv:33395 due to hardware memory corruption"
Slightly modify the error message to improve clarity.Signed-off-by Jane Chu <[email protected]>--- mm/memory-failure.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)mm/memory-failure.c +0
-0
mm/memory-failure.c static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) · line 221
Quoted 9 lines
mm/memory-failure.c +2
-3@@ -216,10 +216,9 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)short addr_lsb = tk->size_shift;int ret; -pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n" , - pfn, t->comm, t->pid); -if ((flags &MF_ACTION_REQUIRED ) && t->mm == current->mm) { +pr_err ("Memory failure: %#lx: Killing %s:%d due to hardware memory " +"corruption\n" , pfn, t->comm, t->pid);
Minor nit, but the string shouldn't be split over multiple lines to preserve grep-ability. In such a case it is usually considered OK to exceed 80 characters for the line if needed.
mm/memory-failure.c static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) · line 235
Quoted 12 lines
mm/memory-failure.c +2
-0ret =force_sig_mceerr (BUS_MCEERR_AR , (void __user *)tk->addr, addr_lsb, current); }else {@@ -229,6 +228,8 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)* This could cause a loop when the user sets SIGBUS * to SIG_IGN, but hopefully no one will do that? */ +pr_err ("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware " +"memory corruption\n" , pfn, t->comm, t->pid); ret =send_sig_mceerr (BUS_MCEERR_AO , (void __user *)tk->addr, addr_lsb, t);/* synchronous? */ }
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm