lkml.org 
[lkml]   [2014]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] UML: UBD: Fix for processes stuck in D state forever in UserModeLinux
Hi Richard.

On 08/23/2014 05:34 PM, Richard Weinberger wrote:
> Hi!
>
> Am 23.08.2014 15:47, schrieb Thorsten Knabe:
>> From: Thorsten Knabe <linux@thorsten-knabe.de>
>>
>> UML: UBD: Fix for processes stuck in D state forever in UserModeLinux.
>>
>> Starting with Linux 3.12 processes get stuck in D state forever in
>> UserModeLinux under sync heavy workloads. This bug was introduced by
>> commit 805f11a0d5 (um: ubd: Add REQ_FLUSH suppport).
>> Fix bug by adding a check if FLUSH request was successfully submitted to
>> the I/O thread and keeping the FLUSH request on the request queue on
>> submission failures.
>>
>> Fixes: 805f11a0d5 (um: ubd: Add REQ_FLUSH suppport)
>> Signed-off-by: Thorsten Knabe <linux@thorsten-knabe.de>
>
> Thanks a lot for hunting this issue down.
>
>> ---
>> Patch applies to 3.16.1.
>>
>> diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
>> index 3716e69..b7d2840 100644
>> --- a/arch/um/drivers/ubd_kern.c
>> +++ b/arch/um/drivers/ubd_kern.c
>> @@ -1277,7 +1277,7 @@ static void do_ubd_request(struct request_queue *q)
>>
>> while(1){
>> struct ubd *dev = q->queuedata;
>> - if(dev->end_sg == 0){
>> + if(dev->request == NULL){
>
> Why do we need this specific change?

This change is required, because for FLUSH requests dev->end_sg is
initialized to 0 by blk_rq_map_sg() a few lines above, as FLUSH requests
have no data blocks attached to themselves.

Checking for dev->end_sg == 0 would then replace a not yet submitted
FLUSH request by the next request on the next iteration of the while
loop, also the FLUSH request was scheduled for resubmission to the I/O
thread.

Kind regards
Thorsten

>
> Thanks,
> //richard
>


--
___
| | / E-Mail: linux@thorsten-knabe.de
|horsten |/\nabe WWW: http://linux.thorsten-knabe.de


\
 
 \ /
  Last update: 2014-08-23 20:01    [W:0.048 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site