2002-07-03 19:04:59

by Teodor Iacob

[permalink] [raw]
Subject: eth0: memory shortage


Hello,

I keep getting these messages (like about twice a day) in the messages:
eth0: memory shortage
eth0: memory shortage
eth1: memory shortage
eth1: memory shortage


Any idea what could be the reason behind this?

I have the following hardware/software configuration:

XP 2000+ / KT333 (Soltek DRV5) / 512MB DDR PC2100
2 x 3Com 3c905 NICs


The kernel is 2.4.19-pre10 with netfilter for bridging patch
applied and it is configured as a bridge between 2 routers
to do filtering for forwarding and packet scheduling (htb)
it has a throughput of 17Mbps, 900 entries in FORWARD chain,
and 700 classes in htb on each card.

Anyway my real question is if I should be worried about
those messages? and of course any solutions if this is a
problem?



--
Teodor Iacob,
Astral TELECOM Internet


2002-07-03 20:12:49

by Mitch Adair

[permalink] [raw]
Subject: Re: eth0: memory shortage

> I keep getting these messages (like about twice a day) in the messages:
> eth0: memory shortage
> eth0: memory shortage
> eth1: memory shortage
> eth1: memory shortage
>
>
> Any idea what could be the reason behind this?

Well this message is coming from drivers/net/3c59x.c in a bit of code that
goes:

/* Refill the Rx ring buffers. */
for (; vp->cur_rx - vp->dirty_rx > 0; vp->dirty_rx++) {
struct sk_buff *skb;
entry = vp->dirty_rx % RX_RING_SIZE;
if (vp->rx_skbuff[entry] == NULL) {
skb = dev_alloc_skb(PKT_BUF_SZ);
if (skb == NULL) {
static unsigned long last_jif;
if ((jiffies - last_jif) > 10 * HZ) {
printk(KERN_WARNING "%s: memory shortage
\n", dev->name);
last_jif = jiffies;
}
if ((vp->cur_rx - vp->dirty_rx) == RX_RING_SIZE)
mod_timer(&vp->rx_oom_timer, RUN_AT(HZ *
1));
break; /* Bad news! */
}


So basically it looks like it is taking much longer to refill rx ring buffers
than it should.

On past 2.4 kernels I recall the eepro100 would report a message of "out
of resources" and the fix suggested there was to increase the values in
/proc/sys/vm/freepages. Perhaps it's a similar issue with the 3c59x ??

Perhaps one of the guru's could comment?

M

2002-07-03 20:24:38

by Andrew Morton

[permalink] [raw]
Subject: Re: eth0: memory shortage

Teodor Iacob wrote:
>
> Hello,
>
> I keep getting these messages (like about twice a day) in the messages:
> eth0: memory shortage
> eth0: memory shortage
> eth1: memory shortage
> eth1: memory shortage
>
> Any idea what could be the reason behind this?
>

It means that the ethernet driver's Rx interrupt handler was not
able to allocate a new receive buffer - there wasn't enough memory
available.

The `kswapd' kernel thread is supposed to make memory available
for interrupt context but in this case it is obviously not keeping
up.

The driver recovers from the failed allocation, so things are OK.

-