Bug 161846 - Problem with b44: SIOCSIFFLAGS: Cannot allocate memory
Problem with b44: SIOCSIFFLAGS: Cannot allocate memory
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: John W. Linville
Brian Brock
:
Depends On:
Blocks: 168429
  Show dependency treegraph
 
Reported: 2005-06-27 14:27 EDT by Andreas Thienemann
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHSA-2006-0132
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-07 14:13:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace showing the offending ifconfig call (4.07 KB, text/plain)
2005-06-27 14:27 EDT, Andreas Thienemann
no flags Details
sysreport output (396.36 KB, application/octet-stream)
2005-06-28 17:16 EDT, Andreas Thienemann
no flags Details
jwltest-b44-alloc.patch (3.01 KB, patch)
2005-06-29 14:09 EDT, John W. Linville
no flags Details | Diff
jwltest-b44-alloc.patch (3.04 KB, patch)
2005-06-29 15:05 EDT, John W. Linville
no flags Details | Diff
jwltest-b44-alloc.patch (7.23 KB, patch)
2005-08-26 15:33 EDT, John W. Linville
no flags Details | Diff

  None (edit)
Description Andreas Thienemann 2005-06-27 14:27:48 EDT
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 192.168.2.2
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 14:27:49 EDT
Created attachment 116027 [details]
strace showing the offending ifconfig call
Comment 2 John W. Linville 2005-06-28 16:46:10 EDT
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 16:52:13 EDT
[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 17:16:38 EDT
Created attachment 116091 [details]
sysreport output
Comment 5 John W. Linville 2005-06-29 14:09:20 EDT
Created attachment 116140 [details]
jwltest-b44-alloc.patch

Yet another hack related to the b44 device's DMA mask...
Comment 6 John W. Linville 2005-06-29 15:05:15 EDT
Created attachment 116141 [details]
jwltest-b44-alloc.patch

Ooops...use this one instead...
Comment 7 John W. Linville 2005-06-29 15:57:20 EDT
Test kernels w/ above patch are available here:  
  
   http://people.redhat.com/linville/kernels/rhel4/ 
 
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 16:36:09 EDT
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 16:48:21 EDT
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 17:19:27 EDT
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 08:28:39 EDT
Setting back to NEEDINFO pending test results... 
Comment 12 Andreas Thienemann 2005-06-30 20:44:26 EDT
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-06-30 21:29:50 EDT
Andreas, it probably goes without saying, but...is the b44 device still able 
to pass traffic after the ifup? :-) 
Comment 14 Andreas Thienemann 2005-06-30 21:42:18 EDT
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 www.bawue.de
PING bender.bawue.de (193.7.176.20) 56(84) bytes of data.
64 bytes from bender.bawue.de (193.7.176.20): icmp_seq=0 ttl=58 time=63.0 ms
64 bytes from bender.bawue.de (193.7.176.20): icmp_seq=1 ttl=58 time=63.0 ms
64 bytes from bender.bawue.de (193.7.176.20): icmp_seq=2 ttl=58 time=65.3 ms
64 bytes from bender.bawue.de (193.7.176.20): icmp_seq=3 ttl=58 time=62.1 ms
64 bytes from bender.bawue.de (193.7.176.20): icmp_seq=4 ttl=58 time=63.4 ms

--- bender.bawue.de 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
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
default         rtr.bb.dicp.net 0.0.0.0         UG    0      0        0 eth1
Comment 19 John W. Linville 2005-08-26 15:33:46 EDT
Created attachment 118173 [details]
jwltest-b44-alloc.patch

Better implementation...
Comment 20 John W. Linville 2005-08-26 15:40:27 EDT
Test kernels w/ above version of patch available here: 
 
   http://people.redhat.com/linville/kernels/rhel4/ 
 
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 14:13:12 EST
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.

http://rhn.redhat.com/errata/RHSA-2006-0132.html

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