From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org,
linux1394-devel@lists.sourceforge.net,
Jody McIntyre <scjody@modernduck.com>,
Ben Collins <bcollins@ubuntu.com>
Subject: [PATCH 2.6.17-rc5-mm2 08/18] ieee1394: save RAM by using a single tlabel for broadcast transactions
Date: Fri, 2 Jun 2006 22:08:14 +0200 (CEST) [thread overview]
Message-ID: <tkrat.29d9bcd5406eb937@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.df7a29e56d67dd0a@s5r6.in-berlin.de>
Since broadcast transactions are already complete when the request has
been sent, the same transaction label can be reused all over again, see
IEEE 1394 7.3.2.5 and 6.2.4.3. Therefore we can reduce the footprint
of struct hpsb_host by the size of one struct hpsb_tlabel_pool.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
drivers/ieee1394/hosts.h | 18 +++++++++---------
drivers/ieee1394/ieee1394_transactions.c | 10 ++++++++--
2 files changed, 17 insertions(+), 11 deletions(-)
Index: linux-2.6.17-rc5-mm2/drivers/ieee1394/hosts.h
===================================================================
--- linux-2.6.17-rc5-mm2.orig/drivers/ieee1394/hosts.h 2006-06-01 20:55:42.000000000 +0200
+++ linux-2.6.17-rc5-mm2/drivers/ieee1394/hosts.h 2006-06-01 20:55:43.000000000 +0200
@@ -30,14 +30,14 @@ struct hpsb_host {
unsigned char iso_listen_count[64];
- int node_count; /* number of identified nodes on this bus */
- int selfid_count; /* total number of SelfIDs received */
- int nodes_active; /* number of nodes with active link layer */
- u8 speed[63]; /* speed between each node and local node */
-
- nodeid_t node_id; /* node ID of this host */
- nodeid_t irm_id; /* ID of this bus' isochronous resource manager */
- nodeid_t busmgr_id; /* ID of this bus' bus manager */
+ int node_count; /* number of identified nodes on this bus */
+ int selfid_count; /* total number of SelfIDs received */
+ int nodes_active; /* number of nodes with active link layer */
+ u8 speed[ALL_NODES]; /* speed between each node and local node */
+
+ nodeid_t node_id; /* node ID of this host */
+ nodeid_t irm_id; /* ID of this bus' isochronous resource manager */
+ nodeid_t busmgr_id; /* ID of this bus' bus manager */
/* this nodes state */
unsigned in_bus_reset:1;
@@ -56,7 +56,7 @@ struct hpsb_host {
struct csr_control csr;
/* Per node tlabel pool allocation */
- struct hpsb_tlabel_pool tpool[64];
+ struct hpsb_tlabel_pool tpool[ALL_NODES];
struct hpsb_host_driver *driver;
Index: linux-2.6.17-rc5-mm2/drivers/ieee1394/ieee1394_transactions.c
===================================================================
--- linux-2.6.17-rc5-mm2.orig/drivers/ieee1394/ieee1394_transactions.c 2006-06-01 20:55:04.000000000 +0200
+++ linux-2.6.17-rc5-mm2/drivers/ieee1394/ieee1394_transactions.c 2006-06-01 20:55:43.000000000 +0200
@@ -136,8 +136,11 @@ int hpsb_get_tlabel(struct hpsb_packet *
{
unsigned long flags;
struct hpsb_tlabel_pool *tp;
+ int n = NODEID_TO_NODE(packet->node_id);
- tp = &packet->host->tpool[packet->node_id & NODE_MASK];
+ if (unlikely(n == ALL_NODES))
+ return 0;
+ tp = &packet->host->tpool[n];
if (irqs_disabled() || in_atomic()) {
if (down_trylock(&tp->count))
@@ -175,8 +178,11 @@ void hpsb_free_tlabel(struct hpsb_packet
{
unsigned long flags;
struct hpsb_tlabel_pool *tp;
+ int n = NODEID_TO_NODE(packet->node_id);
- tp = &packet->host->tpool[packet->node_id & NODE_MASK];
+ if (unlikely(n == ALL_NODES))
+ return;
+ tp = &packet->host->tpool[n];
BUG_ON(packet->tlabel > 63 || packet->tlabel < 0);
next prev parent reply other threads:[~2006-06-02 20:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 19:42 [PATCH 2.6.17-rc5-mm2 00/18] ieee1394: misc updates Stefan Richter
2006-06-02 19:45 ` [PATCH 2.6.17-rc5-mm2 01/18] video1394: be quiet Stefan Richter
2006-06-02 19:46 ` [PATCH 2.6.17-rc5-mm2 02/18] ohci1394.c: function calls without effect Stefan Richter
2006-06-02 19:48 ` [PATCH 2.6.17-rc5-mm2 03/18] sbp2: make TSB42AA9 workaround specific to Momobay CX-1 Stefan Richter
2006-06-02 19:50 ` [PATCH 2.6.17-rc5-mm2 04/18] Semaphore to mutex conversion Stefan Richter
2006-06-02 19:51 ` [PATCH 2.6.17-rc5-mm2 05/18] raw1394: fix whitespace after x86_64 compat patch Stefan Richter
2006-06-02 19:53 ` [PATCH 2.6.17-rc5-mm2 06/18] ieee1394/ohci1394: CycleTooLong interrupt management Stefan Richter
2006-06-02 20:04 ` [PATCH 2.6.17-rc5-mm2 07/18] ieee1394: support for slow links or slow 1394b phy ports Stefan Richter
2006-06-02 20:08 ` Stefan Richter [this message]
2006-06-02 20:10 ` [PATCH 2.6.17-rc5-mm2 09/18] sbp2: remove manipulation of inquiry response Stefan Richter
2006-06-02 20:11 ` [PATCH 2.6.17-rc5-mm2 10/18] sbp2: log number of supported concurrent logins Stefan Richter
2006-06-02 20:13 ` [PATCH 2.6.17-rc5-mm2 11/18] ieee1394: extend lowlevel API for address range properties Stefan Richter
2006-06-02 20:17 ` [PATCH 2.6.17-rc5-mm2 12/18] ohci1394: set " Stefan Richter
2006-06-02 20:20 ` [PATCH 2.6.17-rc5-mm2 13/18] ohci1394: make phys_dma parameter read-only Stefan Richter
2006-06-02 20:22 ` [PATCH 2.6.17-rc5-mm2 14/18] sbp2: sbp2 remove ohci1394 specific constant Stefan Richter
2006-06-02 20:24 ` [PATCH 2.6.17-rc5-mm2 15/18] sbp2: fix S800 transfers if phys_dma is off Stefan Richter
2006-06-02 20:25 ` [PATCH 2.6.17-rc5-mm2 16/18] Update feature removal of obsolete raw1394 ISO requests Stefan Richter
2006-06-02 20:27 ` [PATCH 2.6.17-rc5-mm2 17/18] sbp2: provide helptext for CONFIG_IEEE1394_SBP2_PHYS_DMA and mark it experimental Stefan Richter
2006-06-02 20:28 ` [PATCH 2.6.17-rc5-mm2 18/18] sbp2: use __attribute__((packed)) for on-the-wire structures Stefan Richter
2006-06-02 20:46 ` [PATCH 2.6.17-rc5-mm2 17/18] sbp2: provide helptext for CONFIG_IEEE1394_SBP2_PHYS_DMA and mark it experimental Ben Collins
2006-06-02 21:57 ` Stefan Richter
2006-06-02 22:20 ` Ben Collins
2006-06-02 23:21 ` Stefan Richter
2006-06-02 23:49 ` Ben Collins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tkrat.29d9bcd5406eb937@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=akpm@osdl.org \
--cc=bcollins@ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=scjody@modernduck.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox