Re: buggy GFP_KERNEL allocators

From: Andrea Arcangeli (andrea@suse.de)
Date: Sat Jan 29 2000 - 08:54:27 EST


On Sat, 29 Jan 2000, Andrea Arcangeli wrote:

>--- 2.2.15pre4-raid1/drivers/block/raid1.c.~1~ Tue Dec 22 17:12:38 1998
>+++ 2.2.15pre4-raid1/drivers/block/raid1.c Sat Jan 29 14:45:24 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));

This incremental patch is necessary too

--- 2.2.15pre4-raid1/drivers/block/raid1.c.~1~ Tue Dec 22 17:12:38 1998
+++ 2.2.15pre4-raid1/drivers/block/raid1.c Sat Jan 29 14:49:47 2000
@@ -299,7 +303,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));
 
         /*
@@ -711,7 +719,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));
 

Andrea

-
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.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:23 EST