> -----Original Message-----
> From: Martin K. Petersen [mailto:[email protected]]
> Sent: Thursday, February 22, 2018 9:52 AM
> To: Shivasharan S <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH] megaraid_sas: Re-enable WRITE SAME
>
>
> Hi Shivasharan!
>
> > For MegaRAID controller we want to support WRITE SAME for non-raid
> > volumes.  Because of host wide "no_write_same = 1" settings, we are
> > not able to use provision mode.
>
> The no_write_same flag gates whether the WRITE SAME(10/16) commands
> are
> used to zero block ranges. It does not influence whether WRITE SAME with
> the UNMAP bit set is used to deallocate block ranges on devices which
> support logical block provisioning.

Hi Martin,

Thanks for this clarification. I checked further to understand difference
between
zeroout block ranges and deallocation (unmap) of block ranges using WRITE
SAME
command and impact of setting no_write_same flag.
So my understanding is when driver sets no_write_same flag, it is only
disabling
BLKZEROOUT/write_zeroes requests from using WRITE SAME command.
Instead individual writes are sent to zero the blocks (if
BLKDEV_ZERO_NOFALLBACK flag is not set).

>
> > Virtual Disk will not enable WRITE SAME feature providing correct VPD
> > block limit page.
>
> This wasn't always the case.
>
> If you want to enable WRITE SAME you'll have to provide some sort of
> heuristic to avoid breaking things on firmware versions and controllers
> that predate correct reporting.
>
Our inhouse driver code did not set the no_write_same flag.
And so far we have not seen any issues in this area with inhouse driver.
I am running tests now to check firmware behavior you mentioned.
Will get back to you with the results.

Are you aware of any issue that led to this change?

> > Virtual Disk in MegaRAID provides below values in VPD page 0xb0 which
> > will disable WRITE SAME commands.
>
> A value of 0 in
>
>   Maximum write same length: 0x0 blocks
>
> means the maximum length is not reported. It does not mean that WRITE
> SAME isn't supported.
>

Ok. With latest firmware, for virtual disks we do not set write same/unmap
support
in the logical block provisioning VPD page.
Will check behavior with older firmware versions also and get back.

Logical block provisioning VPD page (SBC):
  Unmap command supported (LBPU): 0
 Write same (16) with unmap bit supported (LBWS): 0
  Write same (10) with unmap bit supported (LBWS10): 0
  Logical block provisioning read zeros (LBPRZ): 0
  Anchored LBAs supported (ANC_SUP): 0
  Threshold exponent: 0
  Descriptor present (DP): 0
  Minimum percentage: 0
  Provisioning type: 0
  Threshold percentage: 0

Thanks,
Shivasharan

> --
> Martin K. Petersen    Oracle Linux Engineering

Reply via email to