All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] request: teach the device more intelligent
@ 2011-08-09  3:47 Kyungmin Park
  2011-08-09 14:04 ` Kyungmin Park
  2011-08-09 18:52 ` Jens Axboe
  0 siblings, 2 replies; 17+ messages in thread
From: Kyungmin Park @ 2011-08-09  3:47 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, arnd, jh80.chung

Hi Jens

Now eMMC device requires the upper layer information to improve the data
performance and reliability.

. Context ID
Using the context information, it can sort out the data internally and improve the performance.
The main problem is that it's needed to define "What's the context". 
Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead

. Data Tag
Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.

With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.

Can you give your opinions and does it proper fields at requests?

Thank you,
Kyungmin Park
---
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 1f96ad6..d73bfa7 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -3790,6 +3790,7 @@ new_queue:
 	rq->elevator_private[0] = cic;
 	rq->elevator_private[1] = cfqq;
 	rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg);
+	rq->hint.context = (int) cfqq->pid;
 	spin_unlock_irqrestore(q->queue_lock, flags);
 	return 0;
 
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0e67c45..0145c10 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -69,6 +69,14 @@ enum rq_cmd_type_bits {
 	REQ_TYPE_ATA_PC,
 };
 
+/*
+ * request hint
+ */
+struct request_hint {
+	int context;			/* Context ID */
+	int hot:1;			/* Hot/cold data */
+};
+
 #define BLK_MAX_CDB	16
 
 /*
@@ -139,6 +147,7 @@ struct request {
 
 	int ref_count;
 
+	struct request_hint hint;	/* request hint information */
 	void *special;		/* opaque pointer available for LLD use */
 	char *buffer;		/* kaddr of the current segment if available */
 

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-09  3:47 [RFC PATCH] request: teach the device more intelligent Kyungmin Park
@ 2011-08-09 14:04 ` Kyungmin Park
  2011-08-10  2:16   ` Namhyung Kim
  2011-08-09 18:52 ` Jens Axboe
  1 sibling, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2011-08-09 14:04 UTC (permalink / raw)
  To: Jens Axboe, jaxboe; +Cc: linux-kernel, arnd, jh80.chung

Cc the correct email address of jens

On Tue, Aug 9, 2011 at 12:47 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> Hi Jens
>
> Now eMMC device requires the upper layer information to improve the data
> performance and reliability.
>
> . Context ID
> Using the context information, it can sort out the data internally and improve the performance.
> The main problem is that it's needed to define "What's the context".
> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>
> . Data Tag
> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>
> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>
> Can you give your opinions and does it proper fields at requests?
>
> Thank you,
> Kyungmin Park
> ---
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index 1f96ad6..d73bfa7 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -3790,6 +3790,7 @@ new_queue:
>        rq->elevator_private[0] = cic;
>        rq->elevator_private[1] = cfqq;
>        rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg);
> +       rq->hint.context = (int) cfqq->pid;
>        spin_unlock_irqrestore(q->queue_lock, flags);
>        return 0;
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 0e67c45..0145c10 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -69,6 +69,14 @@ enum rq_cmd_type_bits {
>        REQ_TYPE_ATA_PC,
>  };
>
> +/*
> + * request hint
> + */
> +struct request_hint {
> +       int context;                    /* Context ID */
> +       int hot:1;                      /* Hot/cold data */
> +};
> +
>  #define BLK_MAX_CDB    16
>
>  /*
> @@ -139,6 +147,7 @@ struct request {
>
>        int ref_count;
>
> +       struct request_hint hint;       /* request hint information */
>        void *special;          /* opaque pointer available for LLD use */
>        char *buffer;           /* kaddr of the current segment if available */
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-09  3:47 [RFC PATCH] request: teach the device more intelligent Kyungmin Park
  2011-08-09 14:04 ` Kyungmin Park
@ 2011-08-09 18:52 ` Jens Axboe
  2011-08-09 23:43   ` Kyungmin Park
  1 sibling, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2011-08-09 18:52 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-kernel, arnd, jh80.chung

On 2011-08-09 05:47, Kyungmin Park wrote:
> Hi Jens
> 
> Now eMMC device requires the upper layer information to improve the data
> performance and reliability.
> 
> . Context ID
> Using the context information, it can sort out the data internally and improve the performance.
> The main problem is that it's needed to define "What's the context". 
> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
> 
> . Data Tag
> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
> 
> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
> 
> Can you give your opinions and does it proper fields at requests?

You need this to work on all IO schedulers, not just cfq. And since
that's the case, there's no need to add this field since you can just
retrieve it if the driver asks for it. For CFQ, it could look like this:

static int cfq_foo(struct request *rq)
{
        struct cfq_queue *cfqq = rq->elevator_private[1];

        if (cfqq)
                return cfqq->pid;

        return -1;
}

As to the hot part, I think that would be better as just a request flag
like eg the meta flag.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-09 18:52 ` Jens Axboe
@ 2011-08-09 23:43   ` Kyungmin Park
  2011-08-10  8:08     ` Jens Axboe
  0 siblings, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2011-08-09 23:43 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, arnd, jh80.chung

On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
> On 2011-08-09 05:47, Kyungmin Park wrote:
>> Hi Jens
>>
>> Now eMMC device requires the upper layer information to improve the data
>> performance and reliability.
>>
>> . Context ID
>> Using the context information, it can sort out the data internally and improve the performance.
>> The main problem is that it's needed to define "What's the context".
>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>
>> . Data Tag
>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>
>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>
>> Can you give your opinions and does it proper fields at requests?
>
> You need this to work on all IO schedulers, not just cfq.
Of course if the concept is acceptable, I'll add the other IO schedulers also.

> And since that's the case, there's no need to add this field since you can just
> retrieve it if the driver asks for it. For CFQ, it could look like this:
>
> static int cfq_foo(struct request *rq)
> {
>        struct cfq_queue *cfqq = rq->elevator_private[1];
>
>        if (cfqq)
>                return cfqq->pid;
>
>        return -1;
> }

The actual user of these information is device driver. e.g.,
drivers/mmc/card/block.c
So it's not good to use cfq data structure at D/D. some time later
these are also used at scsi device drivers.
>
> As to the hot part, I think that would be better as just a request flag
> like eg the meta flag.
Yes it can use the JBD_flags at cfq. but same reason it's not proper
reference at device drivers. that's reason to make a filed at request.

Device driver should or must see the request data structure and don't
refer the upper layer data structures.

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-09 14:04 ` Kyungmin Park
@ 2011-08-10  2:16   ` Namhyung Kim
  0 siblings, 0 replies; 17+ messages in thread
From: Namhyung Kim @ 2011-08-10  2:16 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: Jens Axboe, jaxboe, linux-kernel, arnd, jh80.chung

Kyungmin Park <kmpark@infradead.org> writes:

> Cc the correct email address of jens
>
> On Tue, Aug 9, 2011 at 12:47 PM, Kyungmin Park <kmpark@infradead.org> wrote:
>> Hi Jens
>>
>> Now eMMC device requires the upper layer information to improve the data
>> performance and reliability.
>>
>> . Context ID
>> Using the context information, it can sort out the data internally and improve the performance.
>> The main problem is that it's needed to define "What's the context".
>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>
>> . Data Tag
>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>
>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>
>> Can you give your opinions and does it proper fields at requests?
>>
>> Thank you,
>> Kyungmin Park
>> ---
>> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
>> index 1f96ad6..d73bfa7 100644
>> --- a/block/cfq-iosched.c
>> +++ b/block/cfq-iosched.c
>> @@ -3790,6 +3790,7 @@ new_queue:
>>        rq->elevator_private[0] = cic;
>>        rq->elevator_private[1] = cfqq;
>>        rq->elevator_private[2] = cfq_ref_get_cfqg(cfqq->cfqg);
>> +       rq->hint.context = (int) cfqq->pid;
>>        spin_unlock_irqrestore(q->queue_lock, flags);
>>        return 0;
>>
>> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
>> index 0e67c45..0145c10 100644
>> --- a/include/linux/blkdev.h
>> +++ b/include/linux/blkdev.h
>> @@ -69,6 +69,14 @@ enum rq_cmd_type_bits {
>>        REQ_TYPE_ATA_PC,
>>  };
>>
>> +/*
>> + * request hint
>> + */
>> +struct request_hint {
>> +       int context;                    /* Context ID */
>> +       int hot:1;                      /* Hot/cold data */

This 1-bit member should be a type of unsigned?

Thanks.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-09 23:43   ` Kyungmin Park
@ 2011-08-10  8:08     ` Jens Axboe
  2011-08-10  8:42       ` Kyungmin Park
  0 siblings, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2011-08-10  8:08 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-kernel, arnd, jh80.chung

On 2011-08-10 01:43, Kyungmin Park wrote:
> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>> Hi Jens
>>>
>>> Now eMMC device requires the upper layer information to improve the data
>>> performance and reliability.
>>>
>>> . Context ID
>>> Using the context information, it can sort out the data internally and improve the performance.
>>> The main problem is that it's needed to define "What's the context".
>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>
>>> . Data Tag
>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>
>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>
>>> Can you give your opinions and does it proper fields at requests?
>>
>> You need this to work on all IO schedulers, not just cfq.
> Of course if the concept is acceptable, I'll add the other IO schedulers also.
> 
>> And since that's the case, there's no need to add this field since you can just
>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>
>> static int cfq_foo(struct request *rq)
>> {
>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>
>>        if (cfqq)
>>                return cfqq->pid;
>>
>>        return -1;
>> }
> 
> The actual user of these information is device driver. e.g.,
> drivers/mmc/card/block.c
> So it's not good to use cfq data structure at D/D. some time later
> these are also used at scsi device drivers.

No, what I'm suggesting above is the CFQ implementation. You would need
to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
If you notice, the above function does not take or output anything
related to CFQ in particular, it'll just return you the unique key you
need.

It's either the above, or a field in the request that the schedulers
fill out. However, it'd be somewhat annoying to grow struct request for
something that has a narrow scope of use. Hence the suggestion to add a
strategy helper for this.

>> As to the hot part, I think that would be better as just a request flag
>> like eg the meta flag.
> Yes it can use the JBD_flags at cfq. but same reason it's not proper
> reference at device drivers. that's reason to make a filed at request.
> 
> Device driver should or must see the request data structure and don't
> refer the upper layer data structures.

The device driver sees the struct request, which is where this flag ends
up.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-10  8:08     ` Jens Axboe
@ 2011-08-10  8:42       ` Kyungmin Park
  2011-08-10  8:47         ` Shaohua Li
  0 siblings, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2011-08-10  8:42 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, arnd, jh80.chung, linux-mmc

On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
> On 2011-08-10 01:43, Kyungmin Park wrote:
>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>> Hi Jens
>>>>
>>>> Now eMMC device requires the upper layer information to improve the data
>>>> performance and reliability.
>>>>
>>>> . Context ID
>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>> The main problem is that it's needed to define "What's the context".
>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>
>>>> . Data Tag
>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>
>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>
>>>> Can you give your opinions and does it proper fields at requests?
>>>
>>> You need this to work on all IO schedulers, not just cfq.
>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>
>>> And since that's the case, there's no need to add this field since you can just
>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>
>>> static int cfq_foo(struct request *rq)
>>> {
>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>
>>>        if (cfqq)
>>>                return cfqq->pid;
>>>
>>>        return -1;
>>> }
>>
>> The actual user of these information is device driver. e.g.,
>> drivers/mmc/card/block.c
>> So it's not good to use cfq data structure at D/D. some time later
>> these are also used at scsi device drivers.
>
> No, what I'm suggesting above is the CFQ implementation. You would need
> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
> If you notice, the above function does not take or output anything
> related to CFQ in particular, it'll just return you the unique key you
> need.
>
> It's either the above, or a field in the request that the schedulers
> fill out. However, it'd be somewhat annoying to grow struct request for
> something that has a narrow scope of use. Hence the suggestion to add a
> strategy helper for this.
Okay, I'll add new elevator function one for getting context or more hints.
BTW, does it okay to call elevator function call at D/D?

The quick-n-dirty call is like this at "drivers/mmc/card/block.c"

                struct elevator_queue *e = md->queue.queue->elevator;
                int context = -1;

                if (e->ops->elevator_get_req_hint_fn && req) {
                        context = e->ops->elevator_get_req_hint_fn(req);

>
>>> As to the hot part, I think that would be better as just a request flag
>>> like eg the meta flag.
>> Yes it can use the JBD_flags at cfq. but same reason it's not proper
>> reference at device drivers. that's reason to make a filed at request.
>>
>> Device driver should or must see the request data structure and don't
>> refer the upper layer data structures.
>
> The device driver sees the struct request, which is where this flag ends
> up.
It's ext{3,4} series specific detection method. if user use the
another filesystem, it's difficult to detect hot/cold.
I'll more think about it.

Thank you for suggestion.
Kyungmin Park
>
> --
> Jens Axboe
>
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-10  8:42       ` Kyungmin Park
@ 2011-08-10  8:47         ` Shaohua Li
  2011-08-10  8:55           ` Kyungmin Park
  2011-08-10  9:06           ` Jens Axboe
  0 siblings, 2 replies; 17+ messages in thread
From: Shaohua Li @ 2011-08-10  8:47 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: Jens Axboe, linux-kernel, arnd, jh80.chung, linux-mmc

2011/8/10 Kyungmin Park <kmpark@infradead.org>:
> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>> Hi Jens
>>>>>
>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>> performance and reliability.
>>>>>
>>>>> . Context ID
>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>> The main problem is that it's needed to define "What's the context".
>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>
>>>>> . Data Tag
>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>
>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>
>>>>> Can you give your opinions and does it proper fields at requests?
>>>>
>>>> You need this to work on all IO schedulers, not just cfq.
>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>
>>>> And since that's the case, there's no need to add this field since you can just
>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>
>>>> static int cfq_foo(struct request *rq)
>>>> {
>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>
>>>>        if (cfqq)
>>>>                return cfqq->pid;
>>>>
>>>>        return -1;
>>>> }
>>>
>>> The actual user of these information is device driver. e.g.,
>>> drivers/mmc/card/block.c
>>> So it's not good to use cfq data structure at D/D. some time later
>>> these are also used at scsi device drivers.
>>
>> No, what I'm suggesting above is the CFQ implementation. You would need
>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
>> If you notice, the above function does not take or output anything
>> related to CFQ in particular, it'll just return you the unique key you
>> need.
>>
>> It's either the above, or a field in the request that the schedulers
>> fill out. However, it'd be somewhat annoying to grow struct request for
>> something that has a narrow scope of use. Hence the suggestion to add a
>> strategy helper for this.
> Okay, I'll add new elevator function one for getting context or more hints.
> BTW, does it okay to call elevator function call at D/D?
>
> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>
>                struct elevator_queue *e = md->queue.queue->elevator;
>                int context = -1;
>
>                if (e->ops->elevator_get_req_hint_fn && req) {
>                        context = e->ops->elevator_get_req_hint_fn(req);
I'm wondering how the driver deal with elevator switch. A context id from
one elevator might just be garbage for another elevator.

Thanks,
Shaohua

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-10  8:47         ` Shaohua Li
@ 2011-08-10  8:55           ` Kyungmin Park
  2011-08-10  9:06           ` Jens Axboe
  1 sibling, 0 replies; 17+ messages in thread
From: Kyungmin Park @ 2011-08-10  8:55 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Jens Axboe, linux-kernel, arnd, jh80.chung, linux-mmc

On Wed, Aug 10, 2011 at 5:47 PM, Shaohua Li <shli@kernel.org> wrote:
> 2011/8/10 Kyungmin Park <kmpark@infradead.org>:
>> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>>> Hi Jens
>>>>>>
>>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>>> performance and reliability.
>>>>>>
>>>>>> . Context ID
>>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>>> The main problem is that it's needed to define "What's the context".
>>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>>
>>>>>> . Data Tag
>>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>>
>>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>>
>>>>>> Can you give your opinions and does it proper fields at requests?
>>>>>
>>>>> You need this to work on all IO schedulers, not just cfq.
>>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>>
>>>>> And since that's the case, there's no need to add this field since you can just
>>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>>
>>>>> static int cfq_foo(struct request *rq)
>>>>> {
>>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>>
>>>>>        if (cfqq)
>>>>>                return cfqq->pid;
>>>>>
>>>>>        return -1;
>>>>> }
>>>>
>>>> The actual user of these information is device driver. e.g.,
>>>> drivers/mmc/card/block.c
>>>> So it's not good to use cfq data structure at D/D. some time later
>>>> these are also used at scsi device drivers.
>>>
>>> No, what I'm suggesting above is the CFQ implementation. You would need
>>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
>>> If you notice, the above function does not take or output anything
>>> related to CFQ in particular, it'll just return you the unique key you
>>> need.
>>>
>>> It's either the above, or a field in the request that the schedulers
>>> fill out. However, it'd be somewhat annoying to grow struct request for
>>> something that has a narrow scope of use. Hence the suggestion to add a
>>> strategy helper for this.
>> Okay, I'll add new elevator function one for getting context or more hints.
>> BTW, does it okay to call elevator function call at D/D?
>>
>> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>>
>>                struct elevator_queue *e = md->queue.queue->elevator;
>>                int context = -1;
>>
>>                if (e->ops->elevator_get_req_hint_fn && req) {
>>                        context = e->ops->elevator_get_req_hint_fn(req);
> I'm wondering how the driver deal with elevator switch. A context id from
> one elevator might just be garbage for another elevator.

In case of MMC. it doesn't need to persistent pid. it's enough to use
the temporal context ID.
Please see the test output.

 PID TTY      STAT   TIME COMMAND
...
  346 ?        S      0:01 [kworker/0:1]
  348 ?        S      0:01 [mmcqd/0]
  349 ?        S      0:00 [mmcqd/0boot0]
  350 ?        S      0:00 [mmcqd/0boot1]
  363 ?        S      0:00 [kworker/1:1]
  365 ?        S      0:00 [mmcqd/1]
  369 ?        S      0:00 [jbd2/mmcblk0p3-]
  370 ?        S<     0:00 [ext4-dio-unwrit]
  386 ?        S      0:00 [jbd2/mmcblk0p6-]
  387 ?        S<     0:00 [ext4-dio-unwrit]
  448 ttySAC2  Ss     0:00 -sh
  461 ?        Ss     0:00 /usr/sbin/inetd
  464 ttySAC2  R+     0:00 ps ax

[ 1021.153100] mmc_blk_issue_rq[1203] req df94e7e0, context 448 <- sh
[ 1021.236799] mmc_blk_issue_rq[1203] req df82c8c0, context 448

[ 1023.712727] mmc_blk_issue_rq[1203] req df82c9a0, context 464
[ 1023.722319] mmc_blk_issue_rq[1203] req df82c9a0, context 464
[ 1023.737660] mmc_blk_issue_rq[1203] req df94e700, context 464
[ 1023.744930] mmc_blk_issue_rq[1203] req df94e620, context 464

[ 1025.189639] mmc_blk_issue_rq[1203] req df82c7e0, context 369 <- jbd2
[ 1025.194334] mmc_blk_issue_rq[1203] req df82c9a0, context 369
[ 1025.200157] mmc_blk_issue_rq[1203] req df82cee0, context 369
[ 1025.213215] mmc_blk_issue_rq[1203] req df9a5b08, context 0 <- flush
[ 1025.217627] mmc_blk_issue_rq[1203] req df82cee0, context 0 <- flush

>
> Thanks,
> Shaohua
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-10  8:47         ` Shaohua Li
  2011-08-10  8:55           ` Kyungmin Park
@ 2011-08-10  9:06           ` Jens Axboe
  2011-08-11  0:29             ` Shaohua Li
  1 sibling, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2011-08-10  9:06 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Kyungmin Park, linux-kernel, arnd, jh80.chung, linux-mmc

On 2011-08-10 10:47, Shaohua Li wrote:
> 2011/8/10 Kyungmin Park <kmpark@infradead.org>:
>> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>>> Hi Jens
>>>>>>
>>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>>> performance and reliability.
>>>>>>
>>>>>> . Context ID
>>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>>> The main problem is that it's needed to define "What's the context".
>>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>>
>>>>>> . Data Tag
>>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>>
>>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>>
>>>>>> Can you give your opinions and does it proper fields at requests?
>>>>>
>>>>> You need this to work on all IO schedulers, not just cfq.
>>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>>
>>>>> And since that's the case, there's no need to add this field since you can just
>>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>>
>>>>> static int cfq_foo(struct request *rq)
>>>>> {
>>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>>
>>>>>        if (cfqq)
>>>>>                return cfqq->pid;
>>>>>
>>>>>        return -1;
>>>>> }
>>>>
>>>> The actual user of these information is device driver. e.g.,
>>>> drivers/mmc/card/block.c
>>>> So it's not good to use cfq data structure at D/D. some time later
>>>> these are also used at scsi device drivers.
>>>
>>> No, what I'm suggesting above is the CFQ implementation. You would need
>>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
>>> If you notice, the above function does not take or output anything
>>> related to CFQ in particular, it'll just return you the unique key you
>>> need.
>>>
>>> It's either the above, or a field in the request that the schedulers
>>> fill out. However, it'd be somewhat annoying to grow struct request for
>>> something that has a narrow scope of use. Hence the suggestion to add a
>>> strategy helper for this.
>> Okay, I'll add new elevator function one for getting context or more hints.
>> BTW, does it okay to call elevator function call at D/D?
>>
>> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>>
>>                struct elevator_queue *e = md->queue.queue->elevator;
>>                int context = -1;
>>
>>                if (e->ops->elevator_get_req_hint_fn && req) {
>>                        context = e->ops->elevator_get_req_hint_fn(req);
> I'm wondering how the driver deal with elevator switch. A context id from
> one elevator might just be garbage for another elevator.

Any request with sched private data is drained prior to switching over.
This problem isn't unique to this context id, we have other per-request
IO scheduler data structures associated with the request, too.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-10  9:06           ` Jens Axboe
@ 2011-08-11  0:29             ` Shaohua Li
  2011-08-11  0:36               ` Kyungmin Park
  2011-08-11  7:56               ` Jens Axboe
  0 siblings, 2 replies; 17+ messages in thread
From: Shaohua Li @ 2011-08-11  0:29 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Kyungmin Park, linux-kernel, arnd, jh80.chung, linux-mmc

2011/8/10 Jens Axboe <axboe@kernel.dk>:
> On 2011-08-10 10:47, Shaohua Li wrote:
>> 2011/8/10 Kyungmin Park <kmpark@infradead.org>:
>>> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>>>> Hi Jens
>>>>>>>
>>>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>>>> performance and reliability.
>>>>>>>
>>>>>>> . Context ID
>>>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>>>> The main problem is that it's needed to define "What's the context".
>>>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>>>
>>>>>>> . Data Tag
>>>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>>>
>>>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>>>
>>>>>>> Can you give your opinions and does it proper fields at requests?
>>>>>>
>>>>>> You need this to work on all IO schedulers, not just cfq.
>>>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>>>
>>>>>> And since that's the case, there's no need to add this field since you can just
>>>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>>>
>>>>>> static int cfq_foo(struct request *rq)
>>>>>> {
>>>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>>>
>>>>>>        if (cfqq)
>>>>>>                return cfqq->pid;
>>>>>>
>>>>>>        return -1;
>>>>>> }
>>>>>
>>>>> The actual user of these information is device driver. e.g.,
>>>>> drivers/mmc/card/block.c
>>>>> So it's not good to use cfq data structure at D/D. some time later
>>>>> these are also used at scsi device drivers.
>>>>
>>>> No, what I'm suggesting above is the CFQ implementation. You would need
>>>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
>>>> If you notice, the above function does not take or output anything
>>>> related to CFQ in particular, it'll just return you the unique key you
>>>> need.
>>>>
>>>> It's either the above, or a field in the request that the schedulers
>>>> fill out. However, it'd be somewhat annoying to grow struct request for
>>>> something that has a narrow scope of use. Hence the suggestion to add a
>>>> strategy helper for this.
>>> Okay, I'll add new elevator function one for getting context or more hints.
>>> BTW, does it okay to call elevator function call at D/D?
>>>
>>> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>>>
>>>                struct elevator_queue *e = md->queue.queue->elevator;
>>>                int context = -1;
>>>
>>>                if (e->ops->elevator_get_req_hint_fn && req) {
>>>                        context = e->ops->elevator_get_req_hint_fn(req);
>> I'm wondering how the driver deal with elevator switch. A context id from
>> one elevator might just be garbage for another elevator.
>
> Any request with sched private data is drained prior to switching over.
> This problem isn't unique to this context id, we have other per-request
> IO scheduler data structures associated with the request, too.
what I'm afraid is the context id isn't consistent. Say in cfq, context id
for app1 is 1, app2 2. Then switching to deadline, context id for app1
is 2, app2 1. Will the driver be confused about this?

Thanks,
Shaohua

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-11  0:29             ` Shaohua Li
@ 2011-08-11  0:36               ` Kyungmin Park
  2011-08-11  0:40                 ` Kyungmin Park
                                   ` (2 more replies)
  2011-08-11  7:56               ` Jens Axboe
  1 sibling, 3 replies; 17+ messages in thread
From: Kyungmin Park @ 2011-08-11  0:36 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Jens Axboe, linux-kernel, arnd, jh80.chung, linux-mmc

On Thu, Aug 11, 2011 at 9:29 AM, Shaohua Li <shli@kernel.org> wrote:
> 2011/8/10 Jens Axboe <axboe@kernel.dk>:
>> On 2011-08-10 10:47, Shaohua Li wrote:
>>> 2011/8/10 Kyungmin Park <kmpark@infradead.org>:
>>>> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>>>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>>>>> Hi Jens
>>>>>>>>
>>>>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>>>>> performance and reliability.
>>>>>>>>
>>>>>>>> . Context ID
>>>>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>>>>> The main problem is that it's needed to define "What's the context".
>>>>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>>>>
>>>>>>>> . Data Tag
>>>>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>>>>
>>>>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>>>>
>>>>>>>> Can you give your opinions and does it proper fields at requests?
>>>>>>>
>>>>>>> You need this to work on all IO schedulers, not just cfq.
>>>>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>>>>
>>>>>>> And since that's the case, there's no need to add this field since you can just
>>>>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>>>>
>>>>>>> static int cfq_foo(struct request *rq)
>>>>>>> {
>>>>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>>>>
>>>>>>>        if (cfqq)
>>>>>>>                return cfqq->pid;
>>>>>>>
>>>>>>>        return -1;
>>>>>>> }
>>>>>>
>>>>>> The actual user of these information is device driver. e.g.,
>>>>>> drivers/mmc/card/block.c
>>>>>> So it's not good to use cfq data structure at D/D. some time later
>>>>>> these are also used at scsi device drivers.
>>>>>
>>>>> No, what I'm suggesting above is the CFQ implementation. You would need
>>>>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
>>>>> If you notice, the above function does not take or output anything
>>>>> related to CFQ in particular, it'll just return you the unique key you
>>>>> need.
>>>>>
>>>>> It's either the above, or a field in the request that the schedulers
>>>>> fill out. However, it'd be somewhat annoying to grow struct request for
>>>>> something that has a narrow scope of use. Hence the suggestion to add a
>>>>> strategy helper for this.
>>>> Okay, I'll add new elevator function one for getting context or more hints.
>>>> BTW, does it okay to call elevator function call at D/D?
>>>>
>>>> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>>>>
>>>>                struct elevator_queue *e = md->queue.queue->elevator;
>>>>                int context = -1;
>>>>
>>>>                if (e->ops->elevator_get_req_hint_fn && req) {
>>>>                        context = e->ops->elevator_get_req_hint_fn(req);
>>> I'm wondering how the driver deal with elevator switch. A context id from
>>> one elevator might just be garbage for another elevator.
>>
>> Any request with sched private data is drained prior to switching over.
>> This problem isn't unique to this context id, we have other per-request
>> IO scheduler data structures associated with the request, too.
> what I'm afraid is the context id isn't consistent. Say in cfq, context id
> for app1 is 1, app2 2. Then switching to deadline, context id for app1
> is 2, app2 1. Will the driver be confused about this?

No, no need to consistent. the context id id only valid when several
requests are request the I/O simultaneously
e.g.,
App1 requests A, B, C, D, ...
App2 requests a, b, c, d, ...
App2 requests 1, 2, 3, 4, 5, ...
with following order, A, B, a, 1, C, b, 2, ...

The current eMMC can't handle these operation.

Instead using context, it can teach the these operation comes from
using context ID. and finally can place the request in-order at card
internally.

Open Context ID operation, perform I/O with context Id, ...., and
Close Context ID operation until queue is empty.

Thank you,
Kyungmin Park


>
> Thanks,
> Shaohua
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-11  0:36               ` Kyungmin Park
@ 2011-08-11  0:40                 ` Kyungmin Park
  2011-08-11  1:01                 ` Shaohua Li
  2011-08-11 14:20                 ` Vivek Goyal
  2 siblings, 0 replies; 17+ messages in thread
From: Kyungmin Park @ 2011-08-11  0:40 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Jens Axboe, linux-kernel, arnd, jh80.chung, linux-mmc

On Thu, Aug 11, 2011 at 9:36 AM, Kyungmin Park <kmpark@infradead.org> wrote:
> On Thu, Aug 11, 2011 at 9:29 AM, Shaohua Li <shli@kernel.org> wrote:
>> 2011/8/10 Jens Axboe <axboe@kernel.dk>:
>>> On 2011-08-10 10:47, Shaohua Li wrote:
>>>> 2011/8/10 Kyungmin Park <kmpark@infradead.org>:
>>>>> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>>>>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>>>>>> Hi Jens
>>>>>>>>>
>>>>>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>>>>>> performance and reliability.
>>>>>>>>>
>>>>>>>>> . Context ID
>>>>>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>>>>>> The main problem is that it's needed to define "What's the context".
>>>>>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>>>>>
>>>>>>>>> . Data Tag
>>>>>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>>>>>
>>>>>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>>>>>
>>>>>>>>> Can you give your opinions and does it proper fields at requests?
>>>>>>>>
>>>>>>>> You need this to work on all IO schedulers, not just cfq.
>>>>>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>>>>>
>>>>>>>> And since that's the case, there's no need to add this field since you can just
>>>>>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>>>>>
>>>>>>>> static int cfq_foo(struct request *rq)
>>>>>>>> {
>>>>>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>>>>>
>>>>>>>>        if (cfqq)
>>>>>>>>                return cfqq->pid;
>>>>>>>>
>>>>>>>>        return -1;
>>>>>>>> }
>>>>>>>
>>>>>>> The actual user of these information is device driver. e.g.,
>>>>>>> drivers/mmc/card/block.c
>>>>>>> So it's not good to use cfq data structure at D/D. some time later
>>>>>>> these are also used at scsi device drivers.
>>>>>>
>>>>>> No, what I'm suggesting above is the CFQ implementation. You would need
>>>>>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
>>>>>> If you notice, the above function does not take or output anything
>>>>>> related to CFQ in particular, it'll just return you the unique key you
>>>>>> need.
>>>>>>
>>>>>> It's either the above, or a field in the request that the schedulers
>>>>>> fill out. However, it'd be somewhat annoying to grow struct request for
>>>>>> something that has a narrow scope of use. Hence the suggestion to add a
>>>>>> strategy helper for this.
>>>>> Okay, I'll add new elevator function one for getting context or more hints.
>>>>> BTW, does it okay to call elevator function call at D/D?
>>>>>
>>>>> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>>>>>
>>>>>                struct elevator_queue *e = md->queue.queue->elevator;
>>>>>                int context = -1;
>>>>>
>>>>>                if (e->ops->elevator_get_req_hint_fn && req) {
>>>>>                        context = e->ops->elevator_get_req_hint_fn(req);
>>>> I'm wondering how the driver deal with elevator switch. A context id from
>>>> one elevator might just be garbage for another elevator.
>>>
>>> Any request with sched private data is drained prior to switching over.
>>> This problem isn't unique to this context id, we have other per-request
>>> IO scheduler data structures associated with the request, too.
>> what I'm afraid is the context id isn't consistent. Say in cfq, context id
>> for app1 is 1, app2 2. Then switching to deadline, context id for app1
>> is 2, app2 1. Will the driver be confused about this?
>
> No, no need to consistent. the context id id only valid when several
> requests are request the I/O simultaneously
> e.g.,
> App1 requests A, B, C, D, ...
> App2 requests a, b, c, d, ...
> App2 requests 1, 2, 3, 4, 5, ...
> with following order, A, B, a, 1, C, b, 2, ...
>
> The current eMMC can't handle these operation.
I mean it can't handle it efficiently.
>
> Instead using context, it can teach the these operation comes from
> using context ID. and finally can place the request in-order at card
> internally.
>
> Open Context ID operation, perform I/O with context Id, ...., and
> Close Context ID operation until queue is empty.
>
> Thank you,
> Kyungmin Park
>
>
>>
>> Thanks,
>> Shaohua
>>
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-11  0:36               ` Kyungmin Park
  2011-08-11  0:40                 ` Kyungmin Park
@ 2011-08-11  1:01                 ` Shaohua Li
  2011-08-11 14:20                 ` Vivek Goyal
  2 siblings, 0 replies; 17+ messages in thread
From: Shaohua Li @ 2011-08-11  1:01 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: Jens Axboe, linux-kernel, arnd, jh80.chung, linux-mmc

2011/8/11 Kyungmin Park <kmpark@infradead.org>:
> On Thu, Aug 11, 2011 at 9:29 AM, Shaohua Li <shli@kernel.org> wrote:
>> 2011/8/10 Jens Axboe <axboe@kernel.dk>:
>>> On 2011-08-10 10:47, Shaohua Li wrote:
>>>> 2011/8/10 Kyungmin Park <kmpark@infradead.org>:
>>>>> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>>>>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>>>>>> Hi Jens
>>>>>>>>>
>>>>>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>>>>>> performance and reliability.
>>>>>>>>>
>>>>>>>>> . Context ID
>>>>>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>>>>>> The main problem is that it's needed to define "What's the context".
>>>>>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>>>>>
>>>>>>>>> . Data Tag
>>>>>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>>>>>
>>>>>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>>>>>
>>>>>>>>> Can you give your opinions and does it proper fields at requests?
>>>>>>>>
>>>>>>>> You need this to work on all IO schedulers, not just cfq.
>>>>>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>>>>>
>>>>>>>> And since that's the case, there's no need to add this field since you can just
>>>>>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>>>>>
>>>>>>>> static int cfq_foo(struct request *rq)
>>>>>>>> {
>>>>>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>>>>>
>>>>>>>>        if (cfqq)
>>>>>>>>                return cfqq->pid;
>>>>>>>>
>>>>>>>>        return -1;
>>>>>>>> }
>>>>>>>
>>>>>>> The actual user of these information is device driver. e.g.,
>>>>>>> drivers/mmc/card/block.c
>>>>>>> So it's not good to use cfq data structure at D/D. some time later
>>>>>>> these are also used at scsi device drivers.
>>>>>>
>>>>>> No, what I'm suggesting above is the CFQ implementation. You would need
>>>>>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in.
>>>>>> If you notice, the above function does not take or output anything
>>>>>> related to CFQ in particular, it'll just return you the unique key you
>>>>>> need.
>>>>>>
>>>>>> It's either the above, or a field in the request that the schedulers
>>>>>> fill out. However, it'd be somewhat annoying to grow struct request for
>>>>>> something that has a narrow scope of use. Hence the suggestion to add a
>>>>>> strategy helper for this.
>>>>> Okay, I'll add new elevator function one for getting context or more hints.
>>>>> BTW, does it okay to call elevator function call at D/D?
>>>>>
>>>>> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>>>>>
>>>>>                struct elevator_queue *e = md->queue.queue->elevator;
>>>>>                int context = -1;
>>>>>
>>>>>                if (e->ops->elevator_get_req_hint_fn && req) {
>>>>>                        context = e->ops->elevator_get_req_hint_fn(req);
>>>> I'm wondering how the driver deal with elevator switch. A context id from
>>>> one elevator might just be garbage for another elevator.
>>>
>>> Any request with sched private data is drained prior to switching over.
>>> This problem isn't unique to this context id, we have other per-request
>>> IO scheduler data structures associated with the request, too.
>> what I'm afraid is the context id isn't consistent. Say in cfq, context id
>> for app1 is 1, app2 2. Then switching to deadline, context id for app1
>> is 2, app2 1. Will the driver be confused about this?
>
> No, no need to consistent. the context id id only valid when several
> requests are request the I/O simultaneously
> e.g.,
> App1 requests A, B, C, D, ...
> App2 requests a, b, c, d, ...
> App2 requests 1, 2, 3, 4, 5, ...
> with following order, A, B, a, 1, C, b, 2, ...
>
> The current eMMC can't handle these operation.
>
> Instead using context, it can teach the these operation comes from
> using context ID. and finally can place the request in-order at card
> internally.
>
> Open Context ID operation, perform I/O with context Id, ...., and
> Close Context ID operation until queue is empty.
so just sort the request according to context id in a small interval.
Makes sense. Thanks for the explanation.

Thanks,
Shaohua

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-11  0:29             ` Shaohua Li
  2011-08-11  0:36               ` Kyungmin Park
@ 2011-08-11  7:56               ` Jens Axboe
  1 sibling, 0 replies; 17+ messages in thread
From: Jens Axboe @ 2011-08-11  7:56 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Kyungmin Park, linux-kernel, arnd, jh80.chung, linux-mmc

On 2011-08-11 02:29, Shaohua Li wrote:
> 2011/8/10 Jens Axboe <axboe@kernel.dk>:
>> On 2011-08-10 10:47, Shaohua Li wrote:
>>> 2011/8/10 Kyungmin Park <kmpark@infradead.org>:
>>>> On Wed, Aug 10, 2011 at 5:08 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>> On 2011-08-10 01:43, Kyungmin Park wrote:
>>>>>> On Wed, Aug 10, 2011 at 3:52 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>>>> On 2011-08-09 05:47, Kyungmin Park wrote:
>>>>>>>> Hi Jens
>>>>>>>>
>>>>>>>> Now eMMC device requires the upper layer information to improve the data
>>>>>>>> performance and reliability.
>>>>>>>>
>>>>>>>> . Context ID
>>>>>>>> Using the context information, it can sort out the data internally and improve the performance.
>>>>>>>> The main problem is that it's needed to define "What's the context"..
>>>>>>>> Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead
>>>>>>>>
>>>>>>>> . Data Tag
>>>>>>>> Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable.
>>>>>>>> First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it.
>>>>>>>>
>>>>>>>> With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure.
>>>>>>>>
>>>>>>>> Can you give your opinions and does it proper fields at requests?
>>>>>>>
>>>>>>> You need this to work on all IO schedulers, not just cfq.
>>>>>> Of course if the concept is acceptable, I'll add the other IO schedulers also.
>>>>>>
>>>>>>> And since that's the case, there's no need to add this field since you can just
>>>>>>> retrieve it if the driver asks for it. For CFQ, it could look like this:
>>>>>>>
>>>>>>> static int cfq_foo(struct request *rq)
>>>>>>> {
>>>>>>>        struct cfq_queue *cfqq = rq->elevator_private[1];
>>>>>>>
>>>>>>>        if (cfqq)
>>>>>>>                return cfqq->pid;
>>>>>>>
>>>>>>>        return -1;
>>>>>>> }
>>>>>>
>>>>>> The actual user of these information is device driver. e.g.,
>>>>>> drivers/mmc/card/block.c
>>>>>> So it's not good to use cfq data structure at D/D. some time later
>>>>>> these are also used at scsi device drivers.
>>>>>
>>>>> No, what I'm suggesting above is the CFQ implementation. You would need
>>>>> to wire up an elv_ops->get_foo() and have the IO schedulers fill it in..
>>>>> If you notice, the above function does not take or output anything
>>>>> related to CFQ in particular, it'll just return you the unique key you
>>>>> need.
>>>>>
>>>>> It's either the above, or a field in the request that the schedulers
>>>>> fill out. However, it'd be somewhat annoying to grow struct request for
>>>>> something that has a narrow scope of use. Hence the suggestion to add a
>>>>> strategy helper for this.
>>>> Okay, I'll add new elevator function one for getting context or more hints.
>>>> BTW, does it okay to call elevator function call at D/D?
>>>>
>>>> The quick-n-dirty call is like this at "drivers/mmc/card/block.c"
>>>>
>>>>                struct elevator_queue *e = md->queue.queue->elevator;
>>>>                int context = -1;
>>>>
>>>>                if (e->ops->elevator_get_req_hint_fn && req) {
>>>>                        context = e->ops->elevator_get_req_hint_fn(req);
>>> I'm wondering how the driver deal with elevator switch. A context id from
>>> one elevator might just be garbage for another elevator.
>>
>> Any request with sched private data is drained prior to switching over.
>> This problem isn't unique to this context id, we have other per-request
>> IO scheduler data structures associated with the request, too.
> what I'm afraid is the context id isn't consistent. Say in cfq, context id
> for app1 is 1, app2 2. Then switching to deadline, context id for app1
> is 2, app2 1. Will the driver be confused about this?

It's a hint, so should not be a worry at all. Things should function
perfectly fine with just returning 1 all the time, the idea is to allow
some more efficiency in scheduling on the hw side if we can.
Realistically, the device isn't going to be tracking a ton of pids
anyway. In the rare event of an IO scheduler switch, things will settle
down very quickly.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-11  0:36               ` Kyungmin Park
  2011-08-11  0:40                 ` Kyungmin Park
  2011-08-11  1:01                 ` Shaohua Li
@ 2011-08-11 14:20                 ` Vivek Goyal
  2011-08-12  2:20                   ` Kyungmin Park
  2 siblings, 1 reply; 17+ messages in thread
From: Vivek Goyal @ 2011-08-11 14:20 UTC (permalink / raw)
  To: Kyungmin Park
  Cc: Shaohua Li, Jens Axboe, linux-kernel, arnd, jh80.chung, linux-mmc

On Thu, Aug 11, 2011 at 09:36:04AM +0900, Kyungmin Park wrote:

[...]
> No, no need to consistent. the context id id only valid when several
> requests are request the I/O simultaneously
> e.g.,
> App1 requests A, B, C, D, ...
> App2 requests a, b, c, d, ...
> App2 requests 1, 2, 3, 4, 5, ...
> with following order, A, B, a, 1, C, b, 2, ...
> 
> The current eMMC can't handle these operation.
> 
> Instead using context, it can teach the these operation comes from
> using context ID. and finally can place the request in-order at card
> internally.
> 
> Open Context ID operation, perform I/O with context Id, ...., and
> Close Context ID operation until queue is empty.

Hi Kyungmin,

So once we have context information, we want to process all the requests
from the same context together? IOW, we expect that driver will have
multiple requests in flight from various context and it will batch the
requests from same context together?

How does that help? Is it something related to seeking? If yes, then just
setting the rotational=1 should help as CFQ will sequence all the
sequential IO where it can. For random IO, anyway optimization will not
help. May be it is about something else which I am completely missing.
Some details here will help.

Thanks
Vivek

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH] request: teach the device more intelligent
  2011-08-11 14:20                 ` Vivek Goyal
@ 2011-08-12  2:20                   ` Kyungmin Park
  0 siblings, 0 replies; 17+ messages in thread
From: Kyungmin Park @ 2011-08-12  2:20 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Shaohua Li, Jens Axboe, linux-kernel, arnd, jh80.chung, linux-mmc

On Thu, Aug 11, 2011 at 11:20 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> On Thu, Aug 11, 2011 at 09:36:04AM +0900, Kyungmin Park wrote:
>
> [...]
>> No, no need to consistent. the context id id only valid when several
>> requests are request the I/O simultaneously
>> e.g.,
>> App1 requests A, B, C, D, ...
>> App2 requests a, b, c, d, ...
>> App2 requests 1, 2, 3, 4, 5, ...
>> with following order, A, B, a, 1, C, b, 2, ...
>>
>> The current eMMC can't handle these operation.
>>
>> Instead using context, it can teach the these operation comes from
>> using context ID. and finally can place the request in-order at card
>> internally.
>>
>> Open Context ID operation, perform I/O with context Id, ...., and
>> Close Context ID operation until queue is empty.
>
> Hi Kyungmin,
>
> So once we have context information, we want to process all the requests
> from the same context together? IOW, we expect that driver will have
> multiple requests in flight from various context and it will batch the
> requests from same context together?
It's current implementation. Actually there's no context until eMMC v4.41.
After eMMC v4.5. introduce the context and handle it efficiently if
context is provided from host
>
> How does that help? Is it something related to seeking? If yes, then just
> setting the rotational=1 should help as CFQ will sequence all the
> sequential IO where it can. For random IO, anyway optimization will not
> help. May be it is about something else which I am completely missing.
> Some details here will help.
No, it's dependent on firmware implementation at each vendor. but some
mixed workload, several programs requests the sequential write, and
one or two random write, it can assign the blocks one for sequential,
another for ramdon. don't mix it if context is provided.

Thank you,
Kyungmin Park
>
> Thanks
> Vivek
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-08-12  2:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-09  3:47 [RFC PATCH] request: teach the device more intelligent Kyungmin Park
2011-08-09 14:04 ` Kyungmin Park
2011-08-10  2:16   ` Namhyung Kim
2011-08-09 18:52 ` Jens Axboe
2011-08-09 23:43   ` Kyungmin Park
2011-08-10  8:08     ` Jens Axboe
2011-08-10  8:42       ` Kyungmin Park
2011-08-10  8:47         ` Shaohua Li
2011-08-10  8:55           ` Kyungmin Park
2011-08-10  9:06           ` Jens Axboe
2011-08-11  0:29             ` Shaohua Li
2011-08-11  0:36               ` Kyungmin Park
2011-08-11  0:40                 ` Kyungmin Park
2011-08-11  1:01                 ` Shaohua Li
2011-08-11 14:20                 ` Vivek Goyal
2011-08-12  2:20                   ` Kyungmin Park
2011-08-11  7:56               ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.