diff mbox series

[v3,1/7] block: extend stream count for in-kernel use

Message ID 1553846032-4451-2-git-send-email-joshi.k@samsung.com (mailing list archive)
State New, archived
Headers show
Series Extend write-hint for in-kernel use | expand

Commit Message

Kanchan Joshi March 29, 2019, 7:53 a.m. UTC
This patch bumps up stream count to suppor in-kernel hints. It also
adds 'streamid' member in 'request' and declares new API for driver
to register stream-info with block layer.

Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
---
 include/linux/blkdev.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Andreas Dilger March 30, 2019, 5:48 p.m. UTC | #1
On Mar 29, 2019, at 1:53 AM, Kanchan Joshi <joshi.k@samsung.com> wrote:
> 
> This patch bumps up stream count to suppor in-kernel hints. It also
> adds 'streamid' member in 'request' and declares new API for driver
> to register stream-info with block layer.
> 
> Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
> ---
> include/linux/blkdev.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 338604d..4088e21 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -214,6 +214,7 @@ struct request {
> #endif
> 
> 	unsigned short write_hint;
> +	unsigned short streamid;
> 	unsigned short ioprio;
> 
> 	void *special;		/* opaque pointer available for LLD use */
> @@ -341,6 +342,8 @@ struct queue_limits {
> 	unsigned char		misaligned;
> 	unsigned char		discard_misaligned;
> 	unsigned char		raid_partial_stripes_expensive;
> +
> +	unsigned short		nr_streams;
> 	enum blk_zoned_model	zoned;
> };
> 
> @@ -567,8 +570,9 @@ struct request_queue {
> 	size_t			cmd_size;
> 
> 	struct work_struct	release_work;
> -
> -#define BLK_MAX_WRITE_HINTS	5
> +#define BLK_MAX_USER_HINTS	(WRITE_LIFE_KERN_MIN - 2)
> +#define BLK_MAX_KERN_HINTS	4
> +#define BLK_MAX_WRITE_HINTS	(1 + BLK_MAX_USER_HINTS + BLK_MAX_KERN_HINTS)
> 	u64			write_hints[BLK_MAX_WRITE_HINTS];
> };
> 
> @@ -1071,6 +1075,7 @@ extern void blk_queue_update_dma_alignment(struct request_queue *, int);
> extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
> extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
> extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua);
> +extern void blk_queue_stream_limits(struct request_queue *, unsigned short);

This declaration should be in the 2/7 patch where the function is added.


Cheers, Andreas
Dave Chinner April 1, 2019, 5:02 a.m. UTC | #2
On Fri, Mar 29, 2019 at 01:23:46PM +0530, Kanchan Joshi wrote:
> This patch bumps up stream count to suppor in-kernel hints. It also
> adds 'streamid' member in 'request' and declares new API for driver
> to register stream-info with block layer.
> 
> Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
> ---
>  include/linux/blkdev.h | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 338604d..4088e21 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -214,6 +214,7 @@ struct request {
>  #endif
>  
>  	unsigned short write_hint;
> +	unsigned short streamid;
>  	unsigned short ioprio;
>  
>  	void *special;		/* opaque pointer available for LLD use */
> @@ -341,6 +342,8 @@ struct queue_limits {
>  	unsigned char		misaligned;
>  	unsigned char		discard_misaligned;
>  	unsigned char		raid_partial_stripes_expensive;
> +
> +	unsigned short		nr_streams;
>  	enum blk_zoned_model	zoned;
>  };
>  
> @@ -567,8 +570,9 @@ struct request_queue {
>  	size_t			cmd_size;
>  
>  	struct work_struct	release_work;
> -
> -#define BLK_MAX_WRITE_HINTS	5
> +#define BLK_MAX_USER_HINTS	(WRITE_LIFE_KERN_MIN - 2)

WRITE_LIFE_KERN_MIN is undefined.

-Dave.

> +#define BLK_MAX_KERN_HINTS	4
> +#define BLK_MAX_WRITE_HINTS	(1 + BLK_MAX_USER_HINTS + BLK_MAX_KERN_HINTS)
>  	u64			write_hints[BLK_MAX_WRITE_HINTS];
>  };
>  
> @@ -1071,6 +1075,7 @@ extern void blk_queue_update_dma_alignment(struct request_queue *, int);
>  extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
>  extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
>  extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua);
> +extern void blk_queue_stream_limits(struct request_queue *, unsigned short);
>  
>  /*
>   * Number of physical segments as sent to the device.
> -- 
> 2.7.4
> 
>
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 338604d..4088e21 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -214,6 +214,7 @@  struct request {
 #endif
 
 	unsigned short write_hint;
+	unsigned short streamid;
 	unsigned short ioprio;
 
 	void *special;		/* opaque pointer available for LLD use */
@@ -341,6 +342,8 @@  struct queue_limits {
 	unsigned char		misaligned;
 	unsigned char		discard_misaligned;
 	unsigned char		raid_partial_stripes_expensive;
+
+	unsigned short		nr_streams;
 	enum blk_zoned_model	zoned;
 };
 
@@ -567,8 +570,9 @@  struct request_queue {
 	size_t			cmd_size;
 
 	struct work_struct	release_work;
-
-#define BLK_MAX_WRITE_HINTS	5
+#define BLK_MAX_USER_HINTS	(WRITE_LIFE_KERN_MIN - 2)
+#define BLK_MAX_KERN_HINTS	4
+#define BLK_MAX_WRITE_HINTS	(1 + BLK_MAX_USER_HINTS + BLK_MAX_KERN_HINTS)
 	u64			write_hints[BLK_MAX_WRITE_HINTS];
 };
 
@@ -1071,6 +1075,7 @@  extern void blk_queue_update_dma_alignment(struct request_queue *, int);
 extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
 extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
 extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua);
+extern void blk_queue_stream_limits(struct request_queue *, unsigned short);
 
 /*
  * Number of physical segments as sent to the device.