diff options
author | Dan Aloni <da-x@monatomic.org> | 2007-03-02 23:44:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-03-02 23:44:51 -0500 |
commit | 5c15bdec5c38f4ccf73ef2585fc80a6164de9554 (patch) | |
tree | c99084e96238eb9ce40e8d9d90e0097c4e92111d /drivers/net/bonding/bond_main.c | |
parent | b5284e5aa94be2f88dc92b29e97aff3da0c45f9f (diff) |
[VLAN]: Avoid a 4-order allocation.
This patch splits the vlan_group struct into a multi-allocated struct. On
x86_64, the size of the original struct is a little more than 32KB, causing
a 4-order allocation, which is prune to problems caused by buddy-system
external fragmentation conditions.
I couldn't just use vmalloc() because vfree() cannot be called in the
softirq context of the RCU callback.
Signed-off-by: Dan Aloni <da-x@monatomic.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a7c8f98a890c..ea73ebff4387 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -488,9 +488,9 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) | |||
488 | /* Save and then restore vlan_dev in the grp array, | 488 | /* Save and then restore vlan_dev in the grp array, |
489 | * since the slave's driver might clear it. | 489 | * since the slave's driver might clear it. |
490 | */ | 490 | */ |
491 | vlan_dev = bond->vlgrp->vlan_devices[vid]; | 491 | vlan_dev = vlan_group_get_device(bond->vlgrp, vid); |
492 | slave_dev->vlan_rx_kill_vid(slave_dev, vid); | 492 | slave_dev->vlan_rx_kill_vid(slave_dev, vid); |
493 | bond->vlgrp->vlan_devices[vid] = vlan_dev; | 493 | vlan_group_set_device(bond->vlgrp, vid, vlan_dev); |
494 | } | 494 | } |
495 | } | 495 | } |
496 | 496 | ||
@@ -550,9 +550,9 @@ static void bond_del_vlans_from_slave(struct bonding *bond, struct net_device *s | |||
550 | /* Save and then restore vlan_dev in the grp array, | 550 | /* Save and then restore vlan_dev in the grp array, |
551 | * since the slave's driver might clear it. | 551 | * since the slave's driver might clear it. |
552 | */ | 552 | */ |
553 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 553 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
554 | slave_dev->vlan_rx_kill_vid(slave_dev, vlan->vlan_id); | 554 | slave_dev->vlan_rx_kill_vid(slave_dev, vlan->vlan_id); |
555 | bond->vlgrp->vlan_devices[vlan->vlan_id] = vlan_dev; | 555 | vlan_group_set_device(bond->vlgrp, vlan->vlan_id, vlan_dev); |
556 | } | 556 | } |
557 | 557 | ||
558 | unreg: | 558 | unreg: |
@@ -2397,7 +2397,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2397 | vlan_id = 0; | 2397 | vlan_id = 0; |
2398 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, | 2398 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, |
2399 | vlan_list) { | 2399 | vlan_list) { |
2400 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 2400 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
2401 | if (vlan_dev == rt->u.dst.dev) { | 2401 | if (vlan_dev == rt->u.dst.dev) { |
2402 | vlan_id = vlan->vlan_id; | 2402 | vlan_id = vlan->vlan_id; |
2403 | dprintk("basa: vlan match on %s %d\n", | 2403 | dprintk("basa: vlan match on %s %d\n", |
@@ -2444,7 +2444,7 @@ static void bond_send_gratuitous_arp(struct bonding *bond) | |||
2444 | } | 2444 | } |
2445 | 2445 | ||
2446 | list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { | 2446 | list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { |
2447 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 2447 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
2448 | if (vlan->vlan_ip) { | 2448 | if (vlan->vlan_ip) { |
2449 | bond_arp_send(slave->dev, ARPOP_REPLY, vlan->vlan_ip, | 2449 | bond_arp_send(slave->dev, ARPOP_REPLY, vlan->vlan_ip, |
2450 | vlan->vlan_ip, vlan->vlan_id); | 2450 | vlan->vlan_ip, vlan->vlan_id); |
@@ -3371,7 +3371,7 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
3371 | 3371 | ||
3372 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, | 3372 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, |
3373 | vlan_list) { | 3373 | vlan_list) { |
3374 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 3374 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
3375 | if (vlan_dev == event_dev) { | 3375 | if (vlan_dev == event_dev) { |
3376 | switch (event) { | 3376 | switch (event) { |
3377 | case NETDEV_UP: | 3377 | case NETDEV_UP: |