Re: take5: vector sharing (Large I/O system support)

From: David Mosberger <davidm_at_napali.hpl.hp.com>
Date: 2005-02-04 07:00:20
After a quick glance over the patch:

 - There are several lines introduced with trailing whitespace (some
   of them long).  If you use emacs, you can get rid of them
   with delete-trailing-whitespace.  Please do so.

 - I'm not a fan of coding retry-loops with labels; I'd much rather
   have them be do/while-loops.  In this particular case:

+static struct iosapic_rte_info *iosapic_alloc_rte (void)
+{
+	int index;
+again:
+	/*
+	 * iosapic_alloc_rte might be called before kmalloc is initialized,
+	 * so several number of iosapic_rte_info structures needs to be
+	 * statically allocated.
+	 */
+	index = find_first_zero_bit(iosapic_rte_cache_mask, NR_RTE_CACHE_ENTRIES);
+	if (index < NR_RTE_CACHE_ENTRIES) {
+		if (test_and_set_bit(index, iosapic_rte_cache_mask))
+			goto again;
+		return iosapic_rte_cache + index;
+	}
+
+	return kmalloc(sizeof(struct iosapic_rte_info), GFP_ATOMIC);
+}

How does the kernel fail when we're running out of statically
allocated structures _before_ kmalloc() is initialized?  It better be
an obvious failure so one goes "oh, I better increase
NR_RTE_CACHE_ENTRIES" instead of having to debug a weird crash deep in
the allocator.

	--david
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Feb 3 15:37:50 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:35 EST