mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-20 06:54:38 +00:00
- Some iSCSI performance fixes
- __attribute__((aligned(sizeof(long))) added to all field with different protection than the previous field to make sure they don't share the same bus line. Just in case, actually, compiler should do the alignment by default. - Small docs updates. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1948 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+3
-3
@@ -1449,7 +1449,7 @@ IMPORTANT: Kernels starting from 2.6.32 have a problem, which prevents BLOCKIO
|
||||
Hopefully, it will be fixed soon. Meanwhile, it is recommended to use
|
||||
kernels below 2.6.32 for BLOCKIO on RAID5/DM devices.
|
||||
|
||||
IMPORTANT: If SCST 1.x BLOCKIO worked by default in NV_CACHE mode, when
|
||||
IMPORTANT: In SCST 1.x BLOCKIO worked by default in NV_CACHE mode, when
|
||||
========= each device reported to remote initiators as having write through
|
||||
caching. But if your backend block device has internal write
|
||||
back caching it might create a possibility for data loss of
|
||||
@@ -1458,9 +1458,9 @@ IMPORTANT: If SCST 1.x BLOCKIO worked by default in NV_CACHE mode, when
|
||||
non-NV_CACHE mode, when each device reported to remote
|
||||
initiators as having write back caching, and synchronizes the
|
||||
internal device's cache on each SYNCHRONIZE_CACHE command
|
||||
from the initiators. It might lead to some PERFORMANCE LOSS,
|
||||
from the initiators. It might lead to some *PERFORMANCE LOSS*,
|
||||
so if you are are sure in your power supply and want to
|
||||
restore 1.x behavior, your should recreate your BLOCKIO
|
||||
restore the 1.x behavior, your should recreate your BLOCKIO
|
||||
devices in NV_CACHE mode.
|
||||
|
||||
Pass-through mode
|
||||
|
||||
+22
-11
@@ -1395,7 +1395,8 @@ struct scst_session {
|
||||
/* Used for storage of target driver private stuff */
|
||||
void *tgt_priv;
|
||||
|
||||
unsigned long sess_aflags; /* session's async flags */
|
||||
/* session's async flags */
|
||||
unsigned long sess_aflags __attribute__((aligned(sizeof(long))));
|
||||
|
||||
/*
|
||||
* Hash list of tgt_dev's for this session, protected by scst_mutex
|
||||
@@ -1410,7 +1411,7 @@ struct scst_session {
|
||||
* very beginning, because otherwise they can be missed during
|
||||
* TM processing.
|
||||
*/
|
||||
struct list_head sess_cmd_list;
|
||||
struct list_head sess_cmd_list __attribute__((aligned(sizeof(long))));
|
||||
|
||||
spinlock_t sess_list_lock; /* protects sess_cmd_list, etc */
|
||||
|
||||
@@ -1701,7 +1702,8 @@ struct scst_cmd {
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
unsigned long cmd_flags; /* cmd's async flags */
|
||||
/* cmd's async flags */
|
||||
unsigned long cmd_flags __attribute__((aligned(sizeof(long))));
|
||||
|
||||
/* Keeps status of cmd's status/data delivery to remote initiator */
|
||||
int delivery_status;
|
||||
@@ -2021,7 +2023,7 @@ struct scst_device {
|
||||
** neighbour fields.
|
||||
*************************************************************/
|
||||
|
||||
unsigned long queue_alg:4;
|
||||
unsigned long queue_alg:4 __attribute__((aligned(sizeof(long))));
|
||||
unsigned long tst:3;
|
||||
unsigned long tas:1;
|
||||
unsigned long swp:1;
|
||||
@@ -2037,7 +2039,7 @@ struct scst_device {
|
||||
/**************************************************************/
|
||||
|
||||
/* Set if dev is persistently reserved. Protected by dev_pr_mutex. */
|
||||
unsigned short pr_is_set:1;
|
||||
unsigned short pr_is_set:1 __attribute__((aligned(sizeof(long))));
|
||||
|
||||
/*
|
||||
* Set if there is a thread changing or going to change PR state(s).
|
||||
@@ -2093,7 +2095,7 @@ struct scst_device {
|
||||
*************************************************************/
|
||||
|
||||
/* True if persist through power loss is activated */
|
||||
unsigned short pr_aptpl:1;
|
||||
unsigned short pr_aptpl:1 __attribute__((aligned(sizeof(long))));
|
||||
|
||||
/* Persistent reservation type */
|
||||
uint8_t pr_type;
|
||||
@@ -2134,7 +2136,7 @@ struct scst_device {
|
||||
wait_queue_head_t on_dev_waitQ;
|
||||
|
||||
/* A list entry used during TM, protected by scst_mutex */
|
||||
struct list_head tm_dev_list_entry;
|
||||
struct list_head tm_dev_list_entry __attribute__((aligned(sizeof(long))));
|
||||
|
||||
/* Virtual device internal ID */
|
||||
int virt_id;
|
||||
@@ -2210,7 +2212,8 @@ struct scst_tgt_dev {
|
||||
struct sgv_pool *pool;
|
||||
int max_sg_cnt;
|
||||
|
||||
unsigned long tgt_dev_flags; /* tgt_dev's async flags */
|
||||
/* tgt_dev's async flags */
|
||||
unsigned long tgt_dev_flags __attribute__((aligned(sizeof(long))));
|
||||
|
||||
/* Used for storage of dev handler private stuff */
|
||||
void *dh_priv;
|
||||
@@ -2235,10 +2238,10 @@ struct scst_tgt_dev {
|
||||
struct list_head skipped_sn_list;
|
||||
|
||||
/*
|
||||
* Set if the prev cmd was ORDERED. Size must allow unprotected
|
||||
* modifications independant to the neighbour fields.
|
||||
* Set if the prev cmd was ORDERED. Size and alignment must allow
|
||||
* unprotected modifications independant to the neighbour fields.
|
||||
*/
|
||||
unsigned long prev_cmd_ordered;
|
||||
unsigned long prev_cmd_ordered __attribute__((aligned(sizeof(long))));
|
||||
|
||||
int num_free_sn_slots; /* if it's <0, then all slots are busy */
|
||||
atomic_t *cur_sn_slot;
|
||||
@@ -3147,6 +3150,14 @@ static inline void scst_set_delivery_status(struct scst_cmd *cmd,
|
||||
cmd->delivery_status = delivery_status;
|
||||
}
|
||||
|
||||
static inline unsigned int scst_get_active_cmd_count(struct scst_cmd *cmd)
|
||||
{
|
||||
if (likely(cmd->tgt_dev != NULL))
|
||||
return atomic_read(&cmd->tgt_dev->tgt_dev_cmd_count);
|
||||
else
|
||||
return (unsigned int)-1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get/Set function for mgmt cmd's target private data
|
||||
*/
|
||||
|
||||
@@ -631,7 +631,8 @@ static void vdisk_blockio_check_flush_support(struct scst_vdisk_dev *virt_dev)
|
||||
|
||||
if (blockio_flush(inode->i_bdev) != 0) {
|
||||
PRINT_WARNING("Device %s doesn't support barriers, switching "
|
||||
"to NV_CACHE mode", virt_dev->filename);
|
||||
"to NV_CACHE mode. Read README for more details.",
|
||||
virt_dev->filename);
|
||||
virt_dev->nv_cache = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user