Bug 689551

Summary: cfq-iosched: Fix a potential crash upon frequent group weight change
Product: Red Hat Enterprise Linux 6 Reporter: Vivek Goyal <vgoyal>
Component: kernelAssignee: Vivek Goyal <vgoyal>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-2.6.32-130.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 12:35:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vivek Goyal 2011-03-21 18:50:03 UTC
Description of problem:

It was reported that CFQ has the potential to crash if group weights are changed frequently. It can happen because if weights are changed, they are directly updated in a group (which group is on service tree), leaving the the service tree in an inconsistent state once group is removed from tree.

Fix it by incorporating the weight changes only at certain points like queuing the group where it is safe to do so.

Backport from commit from Jens's tree.

commit 8184f93eced1e304721c2a55c00d87d5a14f8907
Author: Justin TerAvest <teravest>
Date:   Thu Mar 17 16:12:36 2011 +0100

    cfq-iosched: Don't update group weights when on service tree
    
    Version 3 is updated to apply to for-2.6.39/core.
    
    For version 2, I took Vivek's advice and made sure we update the group
    weight from cfq_group_service_tree_add().
    
    If a weight was updated while a group is on the service tree, the
    calculation for the total weight of the service tree can be adjusted
    improperly, which either leads to bad service tree weights, or
    potentially crashes (if total_weight becomes 0).
    
    This patch defers updates to the weight until a group is off the service
    tree.
    
    Signed-off-by: Justin TerAvest <teravest>
    Acked-by: Vivek Goyal <vgoyal>
    Signed-off-by: Jens Axboe <jaxboe>

 
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 RHEL Program Management 2011-03-21 19:07:49 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 4 RHEL Program Management 2011-03-25 19:39:52 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 5 Aristeu Rozanski 2011-04-07 13:51:18 UTC
Patch(es) available on kernel-2.6.32-130.el6

Comment 9 errata-xmlrpc 2011-05-19 12:35:58 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0542.html