lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 20/32] [Suspend2] Return memory needed for block io.
Date
Return the maximum amount of memory needed for block io.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

kernel/power/suspend_block_io.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/power/suspend_block_io.c b/kernel/power/suspend_block_io.c
index 555d4fa..6e0f22c 100644
--- a/kernel/power/suspend_block_io.c
+++ b/kernel/power/suspend_block_io.c
@@ -766,3 +766,12 @@ static int suspend_bdev_page_io(int rw,
return suspend_do_io(rw, &submit_info, 1);
}

+static unsigned long suspend_bio_memory_needed(void)
+{
+ /* We want to have at least enough memory so as to have
+ * MAX_OUTSTANDING_IO transactions on the fly at once. If we
+ * can to more, fine. */
+ return (MAX_OUTSTANDING_IO * (PAGE_SIZE + sizeof(struct request) +
+ sizeof(struct bio) + sizeof(struct io_info)));
+}
+
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-27 01:15    [W:0.105 / U:14.172 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site