Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1422713 > unrolled thread

[PATCH 3.12 35/56] aacraid: Relinquish CPU during timeout wait

Started byJiri Slaby <jslaby@suse.cz>
First post2016-06-15 09:40 +0200
Last post2016-06-15 09:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.12 35/56] aacraid: Relinquish CPU during timeout wait Jiri Slaby <jslaby@suse.cz> - 2016-06-15 09:40 +0200

#1422713 — [PATCH 3.12 35/56] aacraid: Relinquish CPU during timeout wait

FromJiri Slaby <jslaby@suse.cz>
Date2016-06-15 09:40 +0200
Subject[PATCH 3.12 35/56] aacraid: Relinquish CPU during timeout wait
Message-ID<rKdAD-80i-65@gated-at.bofh.it>
From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 07beca2be24cc710461c0b131832524c9ee08910 upstream.

aac_fib_send has a special function case for initial commands during
driver initialization using wait < 0(pseudo sync mode). In this case,
the command does not sleep but rather spins checking for timeout.This
loop is calls cpu_relax() in an attempt to allow other processes/threads
to use the CPU, but this function does not relinquish the CPU and so the
command will hog the processor. This was observed in a KDUMP
"crashkernel" and that prevented the "command thread" (which is
responsible for completing the command from being timed out) from
starting because it could not get the CPU.

Fixed by replacing "cpu_relax()" call with "schedule()"
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/aacraid/commsup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 6b32ddcefc11..06f73d2c878c 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -590,10 +590,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
 					}
 					return -EFAULT;
 				}
-				/* We used to udelay() here but that absorbed
-				 * a CPU when a timeout occured. Not very
-				 * useful. */
-				cpu_relax();
+				/*
+				 * Allow other processes / CPUS to use core
+				 */
+				schedule();
 			}
 		} else if (down_interruptible(&fibptr->event_wait)) {
 			/* Do nothing ... satisfy
-- 
2.9.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web