Re: [PATCH 2/3] swsusp: Do not use page flags

Andrew Morton
2007-03-15T19:09:14Z

> On Mon, 12 Mar 2007 22:19:20 +0100 "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> +int create_basic_memory_bitmaps(void)
> +{
> + struct memory_bitmap *bm1, *bm2;
> + int error = 0;
> +
> + BUG_ON(forbidden_pages_map || free_pages_map);
> +
> + bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_ATOMIC);
> + if (!bm1)
> + return -ENOMEM;
> +
> + error = memory_bm_create(bm1, GFP_ATOMIC | __GFP_COLD, PG_ANY);
> + if (error)
> + goto Free_first_object;
> +
> + bm2 = kzalloc(sizeof(struct memory_bitmap), GFP_ATOMIC);
> + if (!bm2)
> + goto Free_first_bitmap;
> +
> + error = memory_bm_create(bm2, GFP_ATOMIC | __GFP_COLD, PG_ANY);
> + if (error)

What is the risk that we'll go OOM here? GFP_ATOMIC is rather unreliable.

And why _does_ suspend use GFP_ATOMIC all over the place?