In osc_queue_async_io() the cl_loi_list_lock is acquired to reserve
and consume the grant and released, right after we expand the extent
the same lock is used to unreserve the grant.
We can keep the spinlock when we are done with the grant to improve
the throughput.
mpirun -np 32 /root/ior-openmpi/src/ior -w -t 1m -b 8g -F -e -vv
-o /scratch0/file -i 1
master:
Max Write: 13799.70 MiB/sec (14470.04 MB/sec)
master with 33858:
Max Write: 14339.57 MiB/sec (15036.13 MB/sec)
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: Ic61af84c7b98b5a189d7adabe33ae687954b2ed4
Reviewed-on: https://review.whamcloud.com/33858
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
* osc_cache_truncate_start(). */
osc_extent_state_set(ext, OES_TRUNC);
ext->oe_trunc_pending = 0;
* osc_cache_truncate_start(). */
osc_extent_state_set(ext, OES_TRUNC);
ext->oe_trunc_pending = 0;
+ osc_object_unlock(obj);
grant += cli->cl_grant_extent_tax;
if (osc_extent_merge(env, ext, next_extent(ext)) == 0)
grant += cli->cl_grant_extent_tax;
grant += cli->cl_grant_extent_tax;
if (osc_extent_merge(env, ext, next_extent(ext)) == 0)
grant += cli->cl_grant_extent_tax;
- if (grant > 0)
- osc_unreserve_grant(cli, 0, grant);
if (ext->oe_urgent)
list_move_tail(&ext->oe_link,
if (ext->oe_urgent)
list_move_tail(&ext->oe_link,
list_move_tail(&ext->oe_link,
&obj->oo_full_exts);
}
list_move_tail(&ext->oe_link,
&obj->oo_full_exts);
}
+ osc_object_unlock(obj);
+ if (grant > 0)
+ osc_unreserve_grant(cli, 0, grant);
- osc_object_unlock(obj);
osc_io_unplug_async(env, cli, obj);
}
osc_io_unplug_async(env, cli, obj);
}
-static void osc_unreserve_grant(struct client_obd *cli,
- unsigned int reserved, unsigned int unused)
+static void osc_unreserve_grant_nolock(struct client_obd *cli,
+ unsigned int reserved,
+ unsigned int unused)
- spin_lock(&cli->cl_loi_list_lock);
__osc_unreserve_grant(cli, reserved, unused);
if (unused > 0)
osc_wake_cache_waiters(cli);
__osc_unreserve_grant(cli, reserved, unused);
if (unused > 0)
osc_wake_cache_waiters(cli);
+}
+
+static void osc_unreserve_grant(struct client_obd *cli,
+ unsigned int reserved, unsigned int unused)
+{
+ spin_lock(&cli->cl_loi_list_lock);
+ osc_unreserve_grant_nolock(cli, reserved, unused);
spin_unlock(&cli->cl_loi_list_lock);
}
spin_unlock(&cli->cl_loi_list_lock);
}
/* it doesn't need any grant to dirty this page */
spin_lock(&cli->cl_loi_list_lock);
rc = osc_enter_cache_try(cli, oap, grants, 0);
/* it doesn't need any grant to dirty this page */
spin_lock(&cli->cl_loi_list_lock);
rc = osc_enter_cache_try(cli, oap, grants, 0);
- spin_unlock(&cli->cl_loi_list_lock);
if (rc == 0) { /* try failed */
grants = 0;
need_release = 1;
if (rc == 0) { /* try failed */
grants = 0;
need_release = 1;
} else {
OSC_EXTENT_DUMP(D_CACHE, ext,
"expanded for %lu.\n", index);
} else {
OSC_EXTENT_DUMP(D_CACHE, ext,
"expanded for %lu.\n", index);
- osc_unreserve_grant(cli, grants, tmp);
+ osc_unreserve_grant_nolock(cli, grants, tmp);
+ spin_unlock(&cli->cl_loi_list_lock);
rc = 0;
} else if (ext != NULL) {
/* index is located outside of active extent */
rc = 0;
} else if (ext != NULL) {
/* index is located outside of active extent */