Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 319911

Summary: 2.6.9 and interactive task starvation
Product: Red Hat Enterprise Linux 4 Reporter: Bryn M. Reeves <bmr>
Component: kernelAssignee: Bryn M. Reeves <bmr>
Status: CLOSED WONTFIX QA Contact: Martin Jenner <mjenner>
Severity: high Docs Contact:
Priority: high    
Version: 4.5CC: jplans, k.georgiou, tao, vgoyal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-10 14:46:20 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:
Bug Depends On:    
Bug Blocks: 422551, 430698    
Attachments:
Description Flags
Mikes's patch to avoid expired starvation
none
patch re-diffed for 2.6.9-55.EL
none
re-diffed with correct directory prefix none

Description Bryn M. Reeves 2007-10-05 09:39:51 UTC
Description of problem:
The scheduler in 2.6.9 is subject to starvation problems with interactive tasks.
 Insertion of newly activated tasks into the active runqueue array can prevent
the scheduler draining the active array & switching to the inactive array,
effectively starving those tasks in the inactive array.

This is seen for e.g. with a large number of server processes being continually
awoken to service requests.

See:

http://lwn.net/Articles/176635/
http://lwn.net/Articles/176638/

Version-Release number of selected component (if applicable):
2.6.9-55.EL

How reproducible:
100% under the right conditions

Steps to Reproduce:
1. Create a situation where a number of processes are being continuously awoken
to service requests. E.g. configure apache httpd and generate a loadavg of ~10
using the ab tool.
2. Time the execution of some non-interactive tasks in a spare terminal, e.g.:

$ time netstat -n | grep unix | wc -l

  
Actual results:
Execution of the non-interactive tasks is delayed by very long periods (minutes
in some cases) due to starvation of the expired array. 

 
Expected results:
With the attached __activate_task patch applied delays are reported to be
drastically reduced (~10s of seconds).


Additional info:

Comment 1 Bryn M. Reeves 2007-10-05 09:39:51 UTC
Created attachment 217181 [details]
Mikes's  patch to avoid expired starvation

Comment 2 Bryn M. Reeves 2007-10-05 10:59:16 UTC
Created attachment 217221 [details]
patch re-diffed for 2.6.9-55.EL

Comment 4 Bryn M. Reeves 2007-10-05 14:31:21 UTC
Results from a dual core system running httpd at a 1m loadavg of ~6 (load
generated with ab):

RHEL4 baseline:
[root@p380-1 ~]# uname -r
2.6.9-55.ELsmp

[root@p380-1 ~]# time netstat|grep unix|wc -l
20

real    31m34.660s
user    0m4.476s
sys     0m48.278s

RHEL4 with avoid-interactive-starvation-rhel4.patch:
[root@p380-1 ~]# uname -r
2.6.9-55.EL.bz319911smp

[root@p380-1 ~]# time netstat|grep unix|wc -l
20

real    3m13.364s
user    0m4.583s
sys     0m51.709s

Raising severity as this has a huge impact on "victim" processes overall runtime.


Comment 6 Bryn M. Reeves 2007-10-05 19:23:16 UTC
Created attachment 217891 [details]
re-diffed with correct directory prefix

Comment 12 RHEL Program Management 2008-02-05 20:09:44 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.