linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: hch@infradead.org, axboe@fb.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org
Cc: javier@paletta.io, keith.busch@intel.com,
	"Matias Bjørling" <m@bjorling.me>
Subject: [PATCH v3 2/7] block: add REQ_NVM_GC for targets gc
Date: Wed, 22 Apr 2015 16:26:51 +0200	[thread overview]
Message-ID: <1429712816-10336-3-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1429712816-10336-1-git-send-email-m@bjorling.me>

In preparation for Open-Channel SSDs. We introduce a special request for
open-channel ssd targets that must perform garbage collection.

Requests are divided into two types. The user and target specific. User
IOs are from fs, user-space, etc. While target specific are IOs that are
issued in the background by targets. Usually garbage collection actions.

For the target to issue garbage collection requests, it is a requirement
that a logical address is locked over two requests. One read and one
write. If a write to the logical address comes in from user-space, a
race-condition might occur and garbage collection will write out-dated
data.

By introducing this flag, the target can manually control locking of
logical addresses.

Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 include/linux/blk_types.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 272c17e..25c6e02 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -195,6 +195,7 @@ enum rq_flag_bits {
 	__REQ_HASHED,		/* on IO scheduler merge hash */
 	__REQ_MQ_INFLIGHT,	/* track inflight for MQ */
 	__REQ_NO_TIMEOUT,	/* requests may never expire */
+	__REQ_NVM_GC,		/* request is a nvm gc request */
 	__REQ_NR_BITS,		/* stops here */
 };
 
@@ -215,7 +216,7 @@ enum rq_flag_bits {
 #define REQ_COMMON_MASK \
 	(REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \
 	 REQ_DISCARD | REQ_WRITE_SAME | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | \
-	 REQ_SECURE | REQ_INTEGRITY)
+	 REQ_SECURE | REQ_INTEGRITY | REQ_NVM_GC)
 #define REQ_CLONE_MASK		REQ_COMMON_MASK
 
 #define BIO_NO_ADVANCE_ITER_MASK	(REQ_DISCARD|REQ_WRITE_SAME)
@@ -249,5 +250,5 @@ enum rq_flag_bits {
 #define REQ_HASHED		(1ULL << __REQ_HASHED)
 #define REQ_MQ_INFLIGHT		(1ULL << __REQ_MQ_INFLIGHT)
 #define REQ_NO_TIMEOUT		(1ULL << __REQ_NO_TIMEOUT)
-
+#define REQ_NVM_GC		(1ULL << __REQ_NVM_GC)
 #endif /* __LINUX_BLK_TYPES_H */
-- 
1.9.1

  parent reply	other threads:[~2015-04-22 14:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 14:26 [PATCH v3 0/7] Support for Open-Channel SSDs Matias Bjørling
2015-04-22 14:26 ` [PATCH v3 1/7] bio: Introduce LightNVM payload Matias Bjørling
2015-05-09 16:00   ` Christoph Hellwig
2015-05-11 11:58     ` Matias Bjørling
2015-05-12  7:21       ` Christoph Hellwig
2015-04-22 14:26 ` Matias Bjørling [this message]
2015-05-09 16:00   ` [PATCH v3 2/7] block: add REQ_NVM_GC for targets gc Christoph Hellwig
2015-04-22 14:26 ` [PATCH v3 3/7] lightnvm: Support for Open-Channel SSDs Matias Bjørling
2015-04-22 14:26 ` [PATCH v3 4/7] lightnvm: RRPC target Matias Bjørling
2015-04-22 14:26 ` [PATCH v3 5/7] null_blk: LightNVM support Matias Bjørling
2015-04-22 14:26 ` [PATCH v3 6/7] nvme: rename and expose nvme_alloc_iod Matias Bjørling
2015-04-22 14:26 ` [PATCH v3 7/7] nvme: LightNVM support Matias Bjørling
2015-05-05 18:51   ` Matias Bjorling

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=1429712816-10336-3-git-send-email-m@bjorling.me \
    --to=m@bjorling.me \
    --cc=axboe@fb.com \
    --cc=hch@infradead.org \
    --cc=javier@paletta.io \
    --cc=keith.busch@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).