Skip to contentSkip to conversation

blkif discard attributes

DISCUSSION Jan Beulich 4 participants 9 messages Jul 3, 2014 – Jul 16, 2014

lore
Share & tools
lore
#0 lore raw

All (short of there being a specific blkfront/blkback maintainer),

it just occurred to me - shouldn't Linux'es max_discard_sectors and discard_zeroes_data also be communicated from backend to frontend?

Thanks, Jan

#1 lore raw
Quoted 3 lines · Jan Beulich

All (short of there being a specific blkfront/blkback maintainer),

it just occurred to me - shouldn't Linux'es max_discard_sectors and

The backend could split oversized discard requests into several smaller ones.

Quoted 1 line

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

David

#2 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 11:43, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

Don't these attributes gets re-evaluated after restore anyway?

Jan

#3 lore raw
Quoted 9 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 11:43, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

Don't these attributes gets re-evaluated after restore anyway?

I don't see how that helps. What if a discard request was submitted before the suspend, expecting the discard to zero and on restore the requests is queued for the new backend which then might not zero.

David

#4 lore raw
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 12:17, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 11:43, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

Quoted 5 lines
Quoted 1 line

Don't these attributes gets re-evaluated after restore anyway?

I don't see how that helps. What if a discard request was submitted before the suspend, expecting the discard to zero and on restore the requests is queued for the new backend which then might not zero.

Hmm, good point. So it's then indeed better to not communicate this. Albeit similar issues arise with the existing attributes we communicate:
What if the new backend doesn't satisfy the assumptions on the old one? Possibly the request may get failed, but possibly it may also get executed wrongly. Neither of which is very desirable.

Jan

#5 lore raw
Quoted 16 lines · Jan Beulich
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 12:17, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 11:43, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

Quoted 5 lines
Quoted 1 line

Don't these attributes gets re-evaluated after restore anyway?

I don't see how that helps. What if a discard request was submitted before the suspend, expecting the discard to zero and on restore the requests is queued for the new backend which then might not zero.

Quoted 5 lines

Hmm, good point. So it's then indeed better to not communicate this. Albeit similar issues arise with the existing attributes we communicate:
What if the new backend doesn't satisfy the assumptions on the old one? Possibly the request may get failed, but possibly it may also get executed wrongly. Neither of which is very desirable.

That is OK with discard operations. It is OK if they fail intermediately.

Quoted 3 lines

Jan

#6 lore raw
Quoted 17 lines · Konrad Rzeszutek Wilk
Quoted 16 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 12:17, <[email protected]> wrote:
Quoted 9 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 11:43, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

Don't these attributes gets re-evaluated after restore anyway?

I don't see how that helps. What if a discard request was submitted before the suspend, expecting the discard to zero and on restore the requests is queued for the new backend which then might not zero.

Quoted 7 lines
Quoted 5 lines

Hmm, good point. So it's then indeed better to not communicate this. Albeit similar issues arise with the existing attributes we communicate:
What if the new backend doesn't satisfy the assumptions on the old one? Possibly the request may get failed, but possibly it may also get executed wrongly. Neither of which is very desirable.

That is OK with discard operations. It is OK if they fail intermediately.

Are there not security implications to failing a discard? Or do the interfaces not make that promise to the higher layers?

Ian.

#7 lore raw
Quoted 24 lines · Ian Campbell
Quoted 23 lines · Konrad Rzeszutek Wilk
Quoted 21 lines · Jan Beulich
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 12:17, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 11:43, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

Quoted 5 lines
Quoted 1 line

Don't these attributes gets re-evaluated after restore anyway?

I don't see how that helps. What if a discard request was submitted before the suspend, expecting the discard to zero and on restore the requests is queued for the new backend which then might not zero.

Hmm, good point. So it's then indeed better to not communicate this. Albeit similar issues arise with the existing attributes we communicate:
What if the new backend doesn't satisfy the assumptions on the old one? Possibly the request may get failed, but possibly it may also get executed wrongly. Neither of which is very desirable.

Quoted 4 lines
Quoted 1 line

That is OK with discard operations. It is OK if they fail intermediately.

Are there not security implications to failing a discard? Or do the interfaces not make that promise to the higher layers?

No security implications. The semantics behind a discard (ATA UNMAP or SCSI DISCARD) is that it is a hint to the storage device.

If it starts failing, then users can stop issuing the discard operations (or they can continue).

Quoted 3 lines

Ian.

#8 lore raw
Quoted 25 lines · Konrad Rzeszutek Wilk
Quoted 24 lines · Ian Campbell
Quoted 23 lines · Konrad Rzeszutek Wilk
Quoted 21 lines · Jan Beulich
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 12:17, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.14 at 11:43, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

discard_zeroes_data also be communicated from backend to frontend?

Perhaps. But how would you handle a guest that used to have discard_zeroes_data but is restored with different storage that no longer has this property?

Quoted 5 lines
Quoted 1 line

Don't these attributes gets re-evaluated after restore anyway?

I don't see how that helps. What if a discard request was submitted before the suspend, expecting the discard to zero and on restore the requests is queued for the new backend which then might not zero.

Hmm, good point. So it's then indeed better to not communicate this. Albeit similar issues arise with the existing attributes we communicate:
What if the new backend doesn't satisfy the assumptions on the old one? Possibly the request may get failed, but possibly it may also get executed wrongly. Neither of which is very desirable.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

That is OK with discard operations. It is OK if they fail intermediately.

Are there not security implications to failing a discard? Or do the interfaces not make that promise to the higher layers?

No security implications. The semantics behind a discard (ATA UNMAP or SCSI DISCARD) is that it is a hint to the storage device.

OK, great!

Ian.