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][ 16/32] [Suspend2] Add page io to a batch.
Date
Add a page to the current batch. If the batch becomes full as a result,
submit it.

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

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

diff --git a/kernel/power/suspend_block_io.c b/kernel/power/suspend_block_io.c
index 07db518..728df04 100644
--- a/kernel/power/suspend_block_io.c
+++ b/kernel/power/suspend_block_io.c
@@ -556,3 +556,20 @@ static int submit_batched(void)
return num_submitted;
}

+static void add_to_batch(struct io_info *io_info)
+{
+ unsigned long flags;
+
+ set_bit(IO_AWAITING_SUBMIT, &io_info->flags);
+
+ /* Put our prepared I/O struct on the batch list. */
+ spin_lock_irqsave(&ioinfo_submit_lock, flags);
+ list_add_tail(&io_info->list, &ioinfo_submit_batch);
+ spin_unlock_irqrestore(&ioinfo_submit_lock, flags);
+
+ atomic_inc(&submit_batch);
+
+ if (atomic_read(&submit_batch) >= submit_batch_size)
+ submit_batched();
+}
+
--
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:18    [W:0.201 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site