Re: Notebooks

Andi Kleen (ak@muc.de)
19 Aug 1998 02:55:53 +0200


In article <6rd6ek$sr9$1@work.noris.de>,
smurf@noris.de (Matthias Urlichs) writes:
> torvalds@transmeta.com (Linus Torvalds) writes:
>>
>> In this case, TCP wanted to allocate a single skb, and due to slabs this
>> got turned into a multi-page request even though it fit perfectly fine
>> into one page. Thus a critical allocation could fail, and the TCP layer
>> started looping - and kswapd could never even try to fix it up because
>> the TCP code held the kernel lock.
>>
> Methinks that TCP ought to be able to recover from out-of-memory conditions,
> just like any other part of the kernel. If slabs make those things which
> fall over when they don't get their memory fall over more often, that's
> fine with me: it means we get to find more bugs. ;-)

Me thinks it should have a better way to recover from out-of-memory errors
though than:

(from tcp_send_fin)

/* Socket is locked, keep trying until memory is available. */
do {
skb = sock_wmalloc(sk,
(MAX_HEADER +
sk->prot->max_header),
1, GFP_KERNEL);
} while (skb == NULL);

It would be better to return ENOMEM after a few iterations, even if it means
that the fin is not send. It is probably too late in the code freeze to fix
it properly now, but I wouldn't be surprised if it leads to more deadlocks
in the future.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html