Re: [PATCH 2/4] generic-smp: remove kmalloc usage

From: Linus Torvalds
Date: Tue Feb 17 2009 - 10:46:08 EST




On Tue, 17 Feb 2009, Peter Zijlstra wrote:
>
> Ah, no, I don't actually. I remove the kmalloc+call_rcu stuff in 2, not
> the newly cfd mini rcu thing.

I'm not talking about the "mini-rcu", I'm talking about the _existing_ rcu
code that you play games with, just before you then remove it.

See here:

- patch 1/4:

@@ -25,8 +40,11 @@ struct call_function_data {
struct call_single_data csd;
spinlock_t lock;
unsigned int refs;
- struct rcu_head rcu_head;
- unsigned long cpumask_bits[];
+ union {
+ struct rcu_head rcu_head;
+ struct list_head free_list;
+ };
+ struct cpumask cpumask;
};

- patch 2/4:

struct call_function_data {
struct call_single_data csd;
spinlock_t lock;
unsigned int refs;
- union {
- struct rcu_head rcu_head;
- struct list_head free_list;
- };
+ struct list_head free_list;
struct cpumask cpumask;
};

ie that ugly/complex/subtle union of rcu_head that you added in 1/4 you
then remove immediately in 2/4. Making the patches just harder to read.

Just remove it. I'd say fold 1+2 into one patch, instead of playing games
with that thing. Just make the patch remove the kmalloc.

Or at least get rid of the _games_ you play with that union. Now it just
makes the patch unreadable.

Linus
--
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/