Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 161846 - Problem with b44: SIOCSIFFLAGS: Cannot allocate memory
Summary: Problem with b44: SIOCSIFFLAGS: Cannot allocate memory
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: John W. Linville
QA Contact: Brian Brock
Depends On:
Blocks: 168429
TreeView+ depends on / blocked
Reported: 2005-06-27 18:27 UTC by Andreas Thienemann
Modified: 2018-12-02 16:34 UTC (History)
1 user (show)

Fixed In Version: RHSA-2006-0132
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-03-07 19:13:12 UTC
Target Upstream Version:

Attachments (Terms of Use)
strace showing the offending ifconfig call (deleted)
2005-06-27 18:27 UTC, Andreas Thienemann
no flags Details
sysreport output (deleted)
2005-06-28 21:16 UTC, Andreas Thienemann
no flags Details
jwltest-b44-alloc.patch (deleted)
2005-06-29 18:09 UTC, John W. Linville
no flags Details | Diff
jwltest-b44-alloc.patch (deleted)
2005-06-29 19:05 UTC, John W. Linville
no flags Details | Diff
jwltest-b44-alloc.patch (deleted)
2005-08-26 19:33 UTC, John W. Linville
no flags Details | Diff

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:808 normal SHIPPED_LIVE Important: kernel security update 2005-10-27 04:00:00 UTC
Red Hat Product Errata RHSA-2006:0132 qe-ready SHIPPED_LIVE Moderate: Updated kernel packages available for Red Hat Enterprise Linux 4 Update 3 2006-03-09 16:31:00 UTC

Description Andreas Thienemann 2005-06-27 18:27:48 UTC
Description of problem:
Sometimes the following message appears when trying to set up the eth0 device:

[root@bofh /tmp]# ifconfig eth0 up
SIOCSIFFLAGS: Cannot allocate memory

[root@bofh /tmp]# ifconfig eth0
SIOCSIFFLAGS: Cannot allocate memory

This only happens with the primary interface, a b44 ethernet controller.
Wireless and a second usb nic do not show these problems.

The nic in question:
01:0e.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)
        Subsystem: Hewlett-Packard Company: Unknown device 08bc
        Flags: bus master, fast devsel, latency 64, IRQ 11
        Memory at 90080000 (32-bit, non-prefetchable) [size=8K]
        Capabilities: [40] Power Management version 2

The installed kernel is 2.6.9-11EL, but this problem happened with earlier
kernels as well.

Comment 1 Andreas Thienemann 2005-06-27 18:27:49 UTC
Created attachment 116027 [details]
strace showing the offending ifconfig call

Comment 2 John W. Linville 2005-06-28 20:46:10 UTC
Pretty much the only way this can happen is if the open routine for the b44 
driver is unable to allocate memory that it needs to function.  Is your system 
running low on memory? 
If you really think there is some other issue, then please start by attaching 
the output of sysreport. 

Comment 3 Andreas Thienemann 2005-06-28 20:52:13 UTC
[root@bofh /root]# free
             total       used       free     shared    buffers     cached
Mem:        507864     492620      15244          0      13724     144892
-/+ buffers/cache:     334004     173860
Swap:      1048568      51792     996776
[root@bofh /root]# ifconfig eth0 up
SIOCSIFFLAGS: Cannot allocate memory
[root@bofh /root]#

Shouldn't be low on memory.

Sysreport output will follow shortly.

Comment 4 Andreas Thienemann 2005-06-28 21:16:38 UTC
Created attachment 116091 [details]
sysreport output

Comment 5 John W. Linville 2005-06-29 18:09:20 UTC
Created attachment 116140 [details]

Yet another hack related to the b44 device's DMA mask...

Comment 6 John W. Linville 2005-06-29 19:05:15 UTC
Created attachment 116141 [details]

Ooops...use this one instead...

Comment 7 John W. Linville 2005-06-29 19:57:20 UTC
Test kernels w/ above patch are available here: 
Please give them a try to see if it fixes the issue you are seeing.  Please 
post the results of your testing here.  I can't promise that this patch will 
ever be accepted, but if it is known to work then it has a better 
chance... :-) 

Comment 8 Andreas Thienemann 2005-06-29 20:36:09 UTC
will do.

I just don't know how to make sure that the problem really disappeared. I'm not
sure how to reproduce that issue.

Comment 9 John W. Linville 2005-06-29 20:48:21 UTC
The issue was caused by a quirk regarding the b44 hardware and the  
implementation of some memory management in the kernel.  Basically, the b44  
driver ends-up needing to allocate memory from out of the first 16MB of  
physical memory.  
This space gets eaten-up pretty quickly.  Since you are using nearly all of  
your 512MB, it is extremely likely that the first 16MB has been depleted  
already.  This is why you are getting the "Cannot allocate memory" messages. 
To recreate, you probably need to make sure that you open a lot of apps and/or 
keep running for a while.  My guess is that this is what you were doing before 
you saw those messages previously. 
If you can find a scenario that always fails, then try that w/ the test 
kernels and see if it goes away.  Otherwise, just hit the test kernels as hard 
as possible for as long as possible to see if it happens. 

Comment 10 Andreas Thienemann 2005-06-29 21:19:27 UTC
Yeah. That sounds pretty close. Now that I'm thinking about it, this issue only
appeared after having run the notebook for a day or two with lots of applications.

I'll try the new kernel then with a bit of workload...

Comment 11 John W. Linville 2005-06-30 12:28:39 UTC
Setting back to NEEDINFO pending test results... 

Comment 12 Andreas Thienemann 2005-07-01 00:44:26 UTC
Hmmm. After about 8 hours of use with a similar workload to before, the system
does not appear to suffer this issue anymore.

[root@bofh /root]# free              total       used       free     shared   
buffers     cached
Mem:        507832     504680       3152          0      62260     159608
-/+ buffers/cache:     282812     225020
Swap:      1048568      30728    1017840

Thus I'd appreciate it if this patch could make it into a future kernel.

Comment 13 John W. Linville 2005-07-01 01:29:50 UTC
Andreas, it probably goes without saying, the b44 device still able 
to pass traffic after the ifup? :-) 

Comment 14 Andreas Thienemann 2005-07-01 01:42:18 UTC
Hey John, what a question. ;)

Of course:

[root@bofh /root]# route del default
[root@bofh /root]# ifdown eth0
[root@bofh /root]# ifup eth0

Determining IP information for eth0... done.
[root@bofh /root]# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=0 ttl=58 time=63.0 ms
64 bytes from ( icmp_seq=1 ttl=58 time=63.0 ms
64 bytes from ( icmp_seq=2 ttl=58 time=65.3 ms
64 bytes from ( icmp_seq=3 ttl=58 time=62.1 ms
64 bytes from ( icmp_seq=4 ttl=58 time=63.4 ms

--- ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 5628ms
rtt min/avg/max/mdev = 62.187/63.420/65.386/1.069 ms, pipe 2

[root@bofh /root]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     *        U     0      0        0 eth1     *        U     0      0        0 eth0
default         UG    0      0        0 eth1

Comment 19 John W. Linville 2005-08-26 19:33:46 UTC
Created attachment 118173 [details]

Better implementation...

Comment 20 John W. Linville 2005-08-26 19:40:27 UTC
Test kernels w/ above version of patch available here: 
Please give them a try to see if you can recreate the problem.  I don't 
believe you should see the problem anymore on any box with <= 1GB of memory. 
Please post your results here...thanks! 

Comment 28 Red Hat Bugzilla 2006-03-07 19:13:12 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 the 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.

Note You need to log in before you can comment on or make changes to this bug.