Re: [PATCH 2/3] swsusp: Do not use page flags
- From: Pavel Machek <pavel@xxxxxx>
- Date: Fri, 16 Mar 2007 00:05:41 +0100
Hi!
On Mon, 12 Mar 2007 22:19:20 +0100 "Rafael J. Wysocki" <rjw@xxxxxxx> 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.
Well, this can be called after processes (including kswapd) has been frozen.
We can't go to sleep at this point.
So it _is_ unreliable?
We are careful to leave some memory aside for suspend... We actually
free memory at beggining of suspend, and there's some simple "add few
percent for our overhead" there.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 0/3] swsusp: Stop using page flags
- From: Rafael J. Wysocki
- [PATCH 2/3] swsusp: Do not use page flags
- From: Rafael J. Wysocki
- Re: [PATCH 2/3] swsusp: Do not use page flags
- From: Andrew Morton
- Re: [PATCH 2/3] swsusp: Do not use page flags
- From: Rafael J. Wysocki
- Re: [PATCH 2/3] swsusp: Do not use page flags
- From: Andrew Morton
- [PATCH 0/3] swsusp: Stop using page flags
- Prev by Date: Kconfig style question
- Next by Date: Re: thread stacks and strict vm overcommit accounting
- Previous by thread: Re: [PATCH 2/3] swsusp: Do not use page flags
- Next by thread: Re: [PATCH 2/3] swsusp: Do not use page flags
- Index(es):
Relevant Pages
|