aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/hosts.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-07-02 08:17:00 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-09-17 13:17:13 -0400
commit9951903e616662e9a5dad5fbd296690e2ebbbc65 (patch)
tree3d0de40aa9100ccebea03a339dc080f7ad80333e /drivers/ieee1394/hosts.c
parent9b4f2e9576658c4e52d95dc8d309f51b2e2db096 (diff)
ieee1394: shrink tlabel pools, remove tpool semaphores
This patch reduces the size of struct hpsb_host and also removes semaphores from ieee1394_transactions.c. On i386, struct hpsb_host shrinks from 10656 bytes to 6688 bytes. This is accomplished by - using a single wait_queue for hpsb_get_tlabel instead of many instances of semaphores, - using a single lock to serialize access to all tlabel pools (the protected code regions are small, i.e. lock contention very low), - omitting the sysfs attribute tlabels_allocations. Drawback: In the rare case that a process needs to sleep because all transaction labels for the node are temporarily exhausted, it is also woken up if a tlabel for a different node became free, checks for an available tlabel, and is put to sleep again. The check is not costly and the situation occurs extremely rarely. (Tlabels are typically only exhausted if there was no context switch to the khpsbpkt thread which recycles tlables.) Therefore the benefit of reduced tpool size outweighs this drawback. The sysfs attributes tlabels_free and tlabels_mask are not compiled anymore unless CONFIG_IEEE1394_VERBOSEDEBUG is set. The by far biggest member of struct hpsb_host, the struct csr_control csr (5272 bytes on i386), is now placed at the end of struct hpsb_host. Note, hpsb_get_tlabel calls the macro wait_event_interruptible with a condition argument which has a side effect (allocation of a tlabel and manipulation of the packet). This side effect happens only if the condition is true. The patch relies on wait_event_interruptible not evaluating the condition again after it became true. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/hosts.c')
-rw-r--r--drivers/ieee1394/hosts.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c
index 59e6f49545bf..d90a3a1898c0 100644
--- a/drivers/ieee1394/hosts.c
+++ b/drivers/ieee1394/hosts.c
@@ -143,9 +143,6 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
143 for (i = 2; i < 16; i++) 143 for (i = 2; i < 16; i++)
144 h->csr.gen_timestamp[i] = jiffies - 60 * HZ; 144 h->csr.gen_timestamp[i] = jiffies - 60 * HZ;
145 145
146 for (i = 0; i < ARRAY_SIZE(h->tpool); i++)
147 HPSB_TPOOL_INIT(&h->tpool[i]);
148
149 atomic_set(&h->generation, 0); 146 atomic_set(&h->generation, 0);
150 147
151 INIT_WORK(&h->delayed_reset, delayed_reset_bus, h); 148 INIT_WORK(&h->delayed_reset, delayed_reset_bus, h);