public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: linux-kernel@vger.kernel.org
Cc: "Eric D. Mudama" <edmudama@mail.bounceswoosh.org>,
	Jens Axboe <axboe@suse.de>,
	Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
	Ed Tomlinson <edt@aei.ca>, Andrew Morton <akpm@osdl.org>
Subject: flush cache range proposal (was Re: ide errors in 7-rc1-mm1 and later)
Date: Thu, 10 Jun 2004 13:50:05 -0400	[thread overview]
Message-ID: <40C89F4D.4070500@pobox.com> (raw)
In-Reply-To: <20040610164135.GA2230@bounceswoosh.org>

Eric D. Mudama wrote:
> On Thu, Jun 10 at  8:11, Jens Axboe wrote:
> 
>> On Thu, Jun 10 2004, Bartlomiej Zolnierkiewicz wrote:
>>
>>>
>>> /me just thinks loudly
>>>
>>> 'linear range' FLUSH CACHE seems so easy to implement that I always 
>>> wondered
>>> why FLUSH CACHE command doesn't make any use of LBA address and number
>>> of sectors.
>>
>>
>> Indeed, that would be very helpful as well.
> 
> 
> Neat idea... so you send us a LBA and a block count, and we return
> good status if that region is flushed.
> 
> Each command can specify a 32MiB region, assuming a device with
> 512-byte LBAs.
> 
> Propose an exact implementation and an opcode...


Ok, I'll give it a shot:

1) IDENTIFY DEVICE, Word 206, Command set/feature supported

bit 15:		shall be cleared to zero
bit 14:		shall be set to one
bits 13:1:	reserved
bits 0:		1 == flush cache (range) supported

Word 206:

If bit 0 is set to one, the mandatory FLUSH CACHE and FLUSH CACHE EXT 
commands (if implemented) support the RANGE bit, and user-supplied LBA 
and sector count specifying the limits of the cache flush.  This bit 
merely identifies the presence of this feature.  Use word 207, bit 0, to 
determine if the feature is enabled.


2) IDENTIFY DEVICE, Word 207, Command set/feature enabled

bit 15:		shall be cleared to zero
bit 14:		shall be set to one
bits 13:1:	reserved
bits 0:		1 == flush cache (range) enabled

Word 206:

If bit 0 is set to one, the mandatory FLUSH CACHE and FLUSH CACHE EXT 
commands (if implemented) support the RANGE bit, and user-supplied LBA 
and sector count specifying the limits of the cache flush.



3) Modify FLUSH CACHE (E7h) as follows:

Inputs:
-------

Features:	bit 0 (RANGE)
Sector Count:	sector count
LBA Low:	LBA(7:0)
LBA Mid:	LBA(15:8)
LBA High:	LBA(23:16)

Features -
If the RANGE bit is set, the cache flush operation shall be considered 
to be limited to the region specified in Sector Count / LBA registers. 
If the RANGE bit is not set, or the implementation does not support the 
RANGE bit, then the FLUSH CACHE operation shall flush the entire cache.

Sector Count -
Maximum number of sectors to be flushed from the cache.  A value of 00h 
specified that 256 sectors are to be flushed.

LBA Low / Mid / High -
An LBA starting address for the flush.  Register contents as specified 
in READ DMA command, and other commands.


Normal outputs:
---------------
Unchanged.


Error outputs:
--------------
Error register -

RANGE (bit 0) shall be set to one, if RANGE bit was specified in 
Features register when the command was submitted, indicating this was a 
range-based flush cache.


Description
-----------
If RANGE bit is set to one, the flush cache operation at a minimum shall 
flush the specified range of sectors specified by LBA / Sector Count. 
An implementation may choose to flush more than the specified range, up 
to an entire cache flush in a compatible or "no op" implementation.

If no data within the specified LBA range exists in cache to be flushed, 
that shall not be considered an error.


4) Modify FLUSH CACHE EXT (EAh) as follows:

Inputs:
-------

Features:
	curr	bit 0 (RANGE)
	prev	na
Sector Count:
	curr	sector count(7:0)
	prev	sector count(15:8)
LBA Low:
	curr	LBA(7:0)
	prev	LBA(31:24)
LBA Mid:
	curr	LBA(15:8)
	prev	LBA(39:32)
LBA High:
	curr	LBA(23:16)
	prev	LBA(47:40)

Features -
If the RANGE bit is set, the cache flush operation shall be considered 
to be limited to the region specified in Sector Count / LBA registers. 
If the RANGE bit is not set, or the implementation does not support the 
RANGE bit, then the FLUSH CACHE operation shall flush the entire cache.

Sector Count -
Maximum number of sectors to be flushed from the cache.  A value of 
0000h specified that 65,536 sectors are to be flushed.

LBA Low / Mid / High -
An LBA starting address for the flush.  Register contents as specified 
in READ DMA command, and other commands.


Normal outputs:
---------------
Unchanged.


Error outputs:
--------------
Error register -

RANGE (bit 0) shall be set to one, if RANGE bit was specified in 
Features register when the command was submitted, indicating this was a 
range-based flush cache.


Description
-----------
If RANGE bit is set to one, the flush cache operation at a minimum shall 
flush the specified range of sectors specified by LBA / Sector Count. 
An implementation may choose to flush more than the specified range, up 
to an entire cache flush in a compatible or "no op" implementation.

If no data within the specified LBA range exists in cache to be flushed, 
that shall not be considered an error.


</proposal>


Comments requested.

We need to KISS, if this proposal has any hope getting accepted.

People interested in filesystem journalling, barriers and such please 
review.

Once people on lkml are happy, I'll write this up in a PDF in T13 form, 
and propose it on the T13 list (making sure everyone involved is 
properly credited, of course).

	Jeff



  reply	other threads:[~2004-06-10 17:51 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-27 20:24 [2.6.7-rc1-mm1] cant mount reiserfs using -o barrier=flush Günther Persoons
2004-05-27 23:28 ` Ed Tomlinson
2004-05-28 11:54   ` Gunther Persoons
2004-05-28 12:18     ` Jens Axboe
2004-05-28 21:39       ` Ed Tomlinson
2004-05-29  8:30         ` Jens Axboe
2004-06-04  2:07   ` ide errors in 7-rc1-mm1 and later Ed Tomlinson
2004-06-04  2:31     ` Andrew Morton
2004-06-04  9:42       ` Jens Axboe
2004-06-04 11:22         ` Ed Tomlinson
2004-06-04 11:32           ` Jens Axboe
2004-06-04 11:45             ` Jens Axboe
2004-06-04 11:57             ` Bartlomiej Zolnierkiewicz
2004-06-04 12:01               ` Jens Axboe
2004-06-04 12:38                 ` Bartlomiej Zolnierkiewicz
2004-06-04 12:47                   ` Jens Axboe
2004-06-04 13:34                     ` Bartlomiej Zolnierkiewicz
2004-06-04 15:23                       ` Jens Axboe
2004-06-04 16:14                         ` Bartlomiej Zolnierkiewicz
2004-06-05  9:18                           ` Jens Axboe
2004-06-09 21:52                             ` Bartlomiej Zolnierkiewicz
2004-06-09 22:06                               ` Andrew Morton
2004-06-09 23:38                                 ` Bartlomiej Zolnierkiewicz
2004-06-09 23:50                                   ` Andrew Morton
2004-06-10  0:20                                     ` Bartlomiej Zolnierkiewicz
2004-06-10  0:37                                       ` Andrew Morton
2004-06-10  1:02                                         ` Bartlomiej Zolnierkiewicz
2004-06-10  0:28                                     ` Chris Mason
2004-06-10  0:38                                       ` Andrew Morton
2004-06-10  0:45                                         ` Bartlomiej Zolnierkiewicz
2004-06-10 15:14                                         ` Chris Mason
2004-06-10 15:15                                           ` Jens Axboe
2004-06-10  1:05                                       ` Bartlomiej Zolnierkiewicz
2004-06-10  6:27                                   ` Jens Axboe
2004-06-10  6:26                               ` Jens Axboe
2004-06-04 17:29                         ` Jeff Garzik
2004-06-05  9:24                           ` Jens Axboe
2004-06-06 16:18                             ` Eric D. Mudama
2004-06-06 20:46                               ` Jens Axboe
2004-06-10  0:38                               ` Bartlomiej Zolnierkiewicz
2004-06-10  6:11                                 ` Jens Axboe
2004-06-10 16:41                                   ` Eric D. Mudama
2004-06-10 17:50                                     ` Jeff Garzik [this message]
2004-06-10 18:02                                       ` flush cache range proposal (was Re: ide errors in 7-rc1-mm1 and later) Jeff Garzik
2004-06-10 20:33                                         ` Eric D. Mudama
2004-06-11 16:22                                           ` Jeff Garzik
2004-06-11  7:55                                         ` Jens Axboe
2004-06-11 16:17                                           ` Eric D. Mudama
2004-06-11 16:31                                             ` Jeff Garzik
2004-06-11 16:52                                               ` Eric D. Mudama
2004-06-11 16:58                                                 ` Jens Axboe
2004-06-11 16:54                                               ` Jens Axboe
2004-06-11 16:50                                             ` Jens Axboe
2004-06-11 16:24                                           ` Jeff Garzik
2004-06-11  6:10                                       ` Stuart Young
2004-06-26  8:31                                     ` ide errors in 7-rc1-mm1 and later Andre Hedrick
2004-06-26  8:58                                       ` Andre Hedrick
2004-06-28 18:18                                       ` Eric D. Mudama
2004-07-02  8:29                                         ` Jens Axboe
2004-07-07  5:40                                           ` Jeff Garzik
2004-06-04 11:48         ` Bartlomiej Zolnierkiewicz
2004-06-09 23:44     ` Ed Tomlinson
2004-06-09 23:52       ` Andrew Morton
2004-06-10  0:17         ` Ed Tomlinson
2004-06-10  6:29         ` Jens Axboe
2004-06-14 21:42       ` Ed Tomlinson

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=40C89F4D.4070500@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=edmudama@mail.bounceswoosh.org \
    --cc=edt@aei.ca \
    --cc=linux-kernel@vger.kernel.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