diff -urN 2.3.46pre1/drivers/block/raid1.c mm/drivers/block/raid1.c --- 2.3.46pre1/drivers/block/raid1.c Tue Sep 14 14:34:06 1999 +++ mm/drivers/block/raid1.c Thu Feb 17 01:21:02 2000 @@ -211,7 +211,11 @@ while (!( /* FIXME: now we are rather fault tolerant than nice */ r1_bh = kmalloc (sizeof (struct raid1_bh), GFP_KERNEL) ) ) + { printk ("raid1_make_request(#1): out of memory\n"); + current->policy |= SCHED_YIELD; + schedule(); + } memset (r1_bh, 0, sizeof (struct raid1_bh)); /* @@ -298,7 +302,11 @@ while (!( /* FIXME: now we are rather fault tolerant than nice */ mirror_bh[i] = kmalloc (sizeof (struct buffer_head), GFP_KERNEL) ) ) + { printk ("raid1_make_request(#2): out of memory\n"); + current->policy |= SCHED_YIELD; + schedule(); + } memset (mirror_bh[i], 0, sizeof (struct buffer_head)); /* @@ -710,7 +718,11 @@ while (!( /* FIXME: now we are rather fault tolerant than nice */ mddev->private = kmalloc (sizeof (struct raid1_data), GFP_KERNEL) ) ) + { printk ("raid1_run(): out of memory\n"); + current->policy |= SCHED_YIELD; + schedule(); + } raid_conf = mddev->private; memset(raid_conf, 0, sizeof(*raid_conf)); diff -urN 2.3.46pre1/mm/page_alloc.c mm/mm/page_alloc.c --- 2.3.46pre1/mm/page_alloc.c Sat Feb 12 21:03:24 2000 +++ mm/mm/page_alloc.c Thu Feb 17 01:10:03 2000 @@ -298,16 +298,6 @@ } } - /* - * If we can schedule, do so, and make sure to yield. - * We may be a real-time process, and if kswapd is - * waiting for us we need to allow it to run a bit. - */ - if (gfp_mask & __GFP_WAIT) { - current->policy |= SCHED_YIELD; - schedule(); - } - nopage: return NULL; diff -urN 2.3.46pre1/net/ipv4/tcp_output.c mm/net/ipv4/tcp_output.c --- 2.3.46pre1/net/ipv4/tcp_output.c Fri Feb 11 00:05:39 2000 +++ mm/net/ipv4/tcp_output.c Thu Feb 17 01:19:37 2000 @@ -857,11 +857,15 @@ } } else { /* Socket is locked, keep trying until memory is available. */ - do { + for (;;) { skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15, 1, GFP_KERNEL); - } while (skb == NULL); + if (skb) + break; + current->policy |= SCHED_YIELD; + schedule(); + } /* Reserve space for headers and prepare control bits. */ skb_reserve(skb, MAX_TCP_HEADER);