public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Yi Zou <yi.zou@intel.com>
To: linux-scsi@vger.kernel.org
Cc: Vasu Dev <vasu.dev@intel.com>, Yi Zou <yi.zou@intel.com>
Subject: [PATCH 4/6] libfc: cache align fc_exch_pool
Date: Tue, 27 Sep 2011 21:38:08 -0700	[thread overview]
Message-ID: <20110928043807.13004.48356.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110928043601.13004.92207.stgit@localhost6.localdomain6>

From: Vasu Dev <vasu.dev@intel.com>

fix holes and better cache aligned fields.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---

 drivers/scsi/libfc/fc_exch.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index d261e98..7c055fd 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -65,16 +65,15 @@ static struct workqueue_struct *fc_exch_workqueue;
  * assigned range of exchanges to per cpu pool.
  */
 struct fc_exch_pool {
+	spinlock_t	 lock;
+	struct list_head ex_list;
 	u16		 next_index;
 	u16		 total_exches;
 
 	/* two cache of free slot in exch array */
 	u16		 left;
 	u16		 right;
-
-	spinlock_t	 lock;
-	struct list_head ex_list;
-};
+} ____cacheline_aligned_in_smp;
 
 /**
  * struct fc_exch_mgr - The Exchange Manager (EM).
@@ -91,13 +90,13 @@ struct fc_exch_pool {
  * It manages the allocation of exchange IDs.
  */
 struct fc_exch_mgr {
+	struct fc_exch_pool *pool;
+	mempool_t	*ep_pool;
 	enum fc_class	class;
 	struct kref	kref;
 	u16		min_xid;
 	u16		max_xid;
-	mempool_t	*ep_pool;
 	u16		pool_max_index;
-	struct fc_exch_pool *pool;
 
 	/*
 	 * currently exchange mgr stats are updated but not used.


  parent reply	other threads:[~2011-09-28  4:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28  4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
2011-09-28  4:37 ` [PATCH 1/6] fcoe: use kthread_create_on_node Yi Zou
2011-09-28  4:37 ` [PATCH 2/6] libfc: cache align struct fc_fcp_pkt fields Yi Zou
2011-09-28  4:38 ` [PATCH 3/6] libfc: cache align struct fc_exch fields Yi Zou
2011-09-28  4:38 ` Yi Zou [this message]
2011-09-28  4:38 ` [PATCH 5/6] fcoe: use real dev in case of HW vlan acceleration Yi Zou
2011-09-28  4:38 ` [PATCH 6/6] fcoe: setup default initial value for DDP threshold Yi Zou

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=20110928043807.13004.48356.stgit@localhost6.localdomain6 \
    --to=yi.zou@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=vasu.dev@intel.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