lkml.org 
[lkml]   [2006]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 02/13] [Suspend2] Fill skb pool.
Date
Fill the skb pool used to communicate with userspace helpers.

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

kernel/power/netlink.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/kernel/power/netlink.c b/kernel/power/netlink.c
index 8d27801..d169096 100644
--- a/kernel/power/netlink.c
+++ b/kernel/power/netlink.c
@@ -15,3 +15,22 @@
#ifdef CONFIG_NET
struct user_helper_data *uhd_list = NULL;

+/*
+ * Refill our pool of SKBs for use in emergencies (eg, when eating memory and none
+ * can be allocated).
+ */
+static void suspend_fill_skb_pool(struct user_helper_data *uhd)
+{
+ while (uhd->pool_level < uhd->pool_limit) {
+ struct sk_buff *new_skb =
+ alloc_skb(NLMSG_SPACE(uhd->skb_size), GFP_ATOMIC);
+
+ if (!new_skb)
+ break;
+
+ new_skb->next = uhd->emerg_skbs;
+ uhd->emerg_skbs = new_skb;
+ uhd->pool_level++;
+ }
+}
+
--
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 07:07    [from the cache]
©2003-2011 Jasper Spaans