David S. Miller a écrit :
From: Eric Dumazet <[EMAIL PROTECTED]>
Date: Wed, 29 Jun 2005 10:30:23 +0200


[NET] hashed spinlocks in net/ipv4/route.c
 - Locking abstraction
 - Spinlocks moved out of rt hash table : Less memory (50%) used by rt hash 
table. it's a win even on UP.
 - Sizing of spinlocks table depends on NR_CPUS

Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>


Eric, did you hand-edit this patch?


Well, I know for sure I missed the memset(), so I resent the patch reading :

@@ -3118,10 +3148,7 @@
                /* NOTHING */;

        rt_hash_mask--;
-       for (i = 0; i <= rt_hash_mask; i++) {
-               spin_lock_init(&rt_hash_table[i].lock);
-               rt_hash_table[i].chain = NULL;
-       }
+       memset(rt_hash_table, 0, (rt_hash_mask + 1) * sizeof(struct 
rt_hash_bucket));
+       rt_hash_lock_init();


Sorry again for the screwup. I was not aware diff/patch were working like that.
But please check the memset() is there, or else... panic for sure.

Look at this last hunk:

@@ -3118,10 +3148,7 @@
                /* NOTHING */;
rt_hash_mask--;
-       for (i = 0; i <= rt_hash_mask; i++) {
-               spin_lock_init(&rt_hash_table[i].lock);
-               rt_hash_table[i].chain = NULL;
-       }
+       rt_hash_lock_init();
ipv4_dst_ops.gc_thresh = (rt_hash_mask + 1);
        ip_rt_max_size = (rt_hash_mask + 1) * 16;

That hunk header says "10 lines in original, 7 lines in
new" yet the new part actually has 8 lines.

Don't hand edit patches unless you test applying them
after doing so.  Even I manually generate the new diffs
to make sure I don't screw anything up.

I fixed up the diff and applied this patch, but I'd like
to avoid spending time on stuff like that in the future.
Thanks.



Thanks
Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to