lib/ftl: Do not check busy flag when appending
In append case checking if zone is not busy before submitting to it is unnecessary. This patch improves append performance. Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Change-Id: I42f3b31815aa10aed6b0374c2247f857683822f3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1923 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
4ebe50f9ab
commit
074cdb4d06
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include "ftl_io.h"
|
#include "ftl_io.h"
|
||||||
#include "ftl_addr.h"
|
#include "ftl_addr.h"
|
||||||
#include "ftl_io.h"
|
#include "ftl_core.h"
|
||||||
|
|
||||||
/* Number of LBAs that could be stored in a single block */
|
/* Number of LBAs that could be stored in a single block */
|
||||||
#define FTL_NUM_LBA_IN_BLOCK (FTL_BLOCK_SIZE / sizeof(uint64_t))
|
#define FTL_NUM_LBA_IN_BLOCK (FTL_BLOCK_SIZE / sizeof(uint64_t))
|
||||||
@ -275,11 +275,13 @@ ftl_band_zone_is_first(struct ftl_band *band, struct ftl_zone *zone)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
ftl_zone_is_writable(const struct ftl_zone *zone)
|
ftl_zone_is_writable(const struct spdk_ftl_dev *dev, const struct ftl_zone *zone)
|
||||||
{
|
{
|
||||||
|
bool busy = ftl_is_append_supported(dev) ? false : zone->busy;
|
||||||
|
|
||||||
return (zone->info.state == SPDK_BDEV_ZONE_STATE_OPEN ||
|
return (zone->info.state == SPDK_BDEV_ZONE_STATE_OPEN ||
|
||||||
zone->info.state == SPDK_BDEV_ZONE_STATE_EMPTY) &&
|
zone->info.state == SPDK_BDEV_ZONE_STATE_EMPTY) &&
|
||||||
!zone->busy;
|
!busy;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FTL_BAND_H */
|
#endif /* FTL_BAND_H */
|
||||||
|
@ -820,7 +820,7 @@ ftl_wptr_ready(struct ftl_wptr *wptr)
|
|||||||
|
|
||||||
/* TODO: add handling of empty bands */
|
/* TODO: add handling of empty bands */
|
||||||
|
|
||||||
if (spdk_unlikely(!ftl_zone_is_writable(wptr->zone))) {
|
if (spdk_unlikely(!ftl_zone_is_writable(wptr->dev, wptr->zone))) {
|
||||||
/* Erasing band may fail after it was assigned to wptr. */
|
/* Erasing band may fail after it was assigned to wptr. */
|
||||||
if (spdk_unlikely(wptr->zone->info.state == SPDK_BDEV_ZONE_STATE_OFFLINE)) {
|
if (spdk_unlikely(wptr->zone->info.state == SPDK_BDEV_ZONE_STATE_OFFLINE)) {
|
||||||
ftl_wptr_advance(wptr, wptr->dev->xfer_size);
|
ftl_wptr_advance(wptr, wptr->dev->xfer_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user