From: Vasu Dev Date: Wed, 28 Sep 2011 04:38:08 +0000 (-0700) Subject: [SCSI] libfc: cache align fc_exch_pool X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e17b4af7c7a6f5c24b0e6b856bb45a1a22be75f5;p=mv-sheeva.git [SCSI] libfc: cache align fc_exch_pool fix holes and better cache aligned fields. Signed-off-by: Vasu Dev Tested-by: Ross Brattain Signed-off-by: Yi Zou Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 01ff082dc34..a78655b86cb 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.