All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] LVM blocks discard for remove commands
@ 2011-10-19 10:45 Yann Droneaud
  2011-10-19 14:09 ` Yann Droneaud
  0 siblings, 1 reply; 4+ messages in thread
From: Yann Droneaud @ 2011-10-19 10:45 UTC (permalink / raw)
  To: linux-lvm

Hi,

Does lvremove, vgremove, pvremove issue discard (eg. TRIM) commands
in order to release LE/PE/metadata blocks from the underlying devices (SSD) ?

If LVM don't do it now, is it a planned feature ?

Meanwhile, which methods can be used to discard/TRIM blocks when removing
a LV, or a VG, or PV, without wiping the complete underlying device.

Something to feed hdparm --trim-sector-ranges once the LV, VG or PV is
removed for example ?

Regards

-- 
Yann Droneaud

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

* Re: [linux-lvm] LVM blocks discard for remove commands
  2011-10-19 10:45 [linux-lvm] LVM blocks discard for remove commands Yann Droneaud
@ 2011-10-19 14:09 ` Yann Droneaud
  2011-10-19 14:24   ` Mike Snitzer
  0 siblings, 1 reply; 4+ messages in thread
From: Yann Droneaud @ 2011-10-19 14:09 UTC (permalink / raw)
  To: LVM general discussion and development

Le mercredi 19 octobre 2011 à 12:45 +0200, Yann Droneaud a écrit :
> Hi,
> 
> Does lvremove, vgremove, pvremove issue discard (eg. TRIM) commands
> in order to release LE/PE/metadata blocks from the underlying devices (SSD) ?
> 

It seems the discard feature was added to LVM2 since version 2.02.85
(released on 29th April 2011), in WHATS_NEW:

  Add "devices/issue_discards" to lvm.conf.
  Issue discards on lvremove and lvreduce etc. if enabled and supported.

But the documentation is unclear about it. In example.conf.in /
lvm.conf.5.in:

"
Issue discards to a logical volumes's underlying physical volume(s) when
the logical volume is no longer using the physical volumes' space (e.g.
lvremove, lvreduce, etc).  Discards inform the storage that a region is
no longer in use.  Storage that supports discards advertise the protocol
specific way discards should be issued by the kernel (TRIM, UNMAP, or
WRITE SAME with UNMAP bit set).  Not all storage will support or benefit
from discards but SSDs and thinly provisioned LUNs generally do.  If set
to 1, discards will only be issued if both the storage and kernel
provide support.
"


Does it apply for the blocks holding meta data,
e.g. will pvremove issue discard requests for the PV meta data ?

Regards.

-- 
Yann Droneaud

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

* Re: [linux-lvm] LVM blocks discard for remove commands
  2011-10-19 14:09 ` Yann Droneaud
@ 2011-10-19 14:24   ` Mike Snitzer
  2011-10-19 14:37     ` Stuart D. Gathman
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Snitzer @ 2011-10-19 14:24 UTC (permalink / raw)
  To: Yann Droneaud; +Cc: LVM general discussion and development

On Wed, Oct 19 2011 at 10:09am -0400,
Yann Droneaud <yann@droneaud.fr> wrote:

> Le mercredi 19 octobre 2011 � 12:45 +0200, Yann Droneaud a �crit :
> > Hi,
> > 
> > Does lvremove, vgremove, pvremove issue discard (eg. TRIM) commands
> > in order to release LE/PE/metadata blocks from the underlying devices (SSD) ?
> > 
> 
> It seems the discard feature was added to LVM2 since version 2.02.85
> (released on 29th April 2011), in WHATS_NEW:
> 
>   Add "devices/issue_discards" to lvm.conf.
>   Issue discards on lvremove and lvreduce etc. if enabled and supported.
> 
> But the documentation is unclear about it. In example.conf.in /
> lvm.conf.5.in:
> 
> "
> Issue discards to a logical volumes's underlying physical volume(s) when
> the logical volume is no longer using the physical volumes' space (e.g.
> lvremove, lvreduce, etc).  Discards inform the storage that a region is
> no longer in use.  Storage that supports discards advertise the protocol
> specific way discards should be issued by the kernel (TRIM, UNMAP, or
> WRITE SAME with UNMAP bit set).  Not all storage will support or benefit
> from discards but SSDs and thinly provisioned LUNs generally do.  If set
> to 1, discards will only be issued if both the storage and kernel
> provide support.
> "
> 
> 
> Does it apply for the blocks holding meta data,
> e.g. will pvremove issue discard requests for the PV meta data ?

The discards are only issued for the physical extents that were used in
a volume's data area.  PV metadata isn't discarded, and really there
would be little benefit to doing so.

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

* Re: [linux-lvm] LVM blocks discard for remove commands
  2011-10-19 14:24   ` Mike Snitzer
@ 2011-10-19 14:37     ` Stuart D. Gathman
  0 siblings, 0 replies; 4+ messages in thread
From: Stuart D. Gathman @ 2011-10-19 14:37 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Yann Droneaud

On Wed, 19 Oct 2011, Mike Snitzer wrote:

>> Does it apply for the blocks holding meta data,
>> e.g. will pvremove issue discard requests for the PV meta data ?
>
> The discards are only issued for the physical extents that were used in
> a volume's data area.  PV metadata isn't discarded, and really there
> would be little benefit to doing so.

The metadata is written over so that the PV is no longer recognized. 
I think that issuing a discard for the metadata would actually be
incorrect.

--
 	      Stuart D. Gathman <stuart@bmsi.com>
     Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

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

end of thread, other threads:[~2011-10-19 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 10:45 [linux-lvm] LVM blocks discard for remove commands Yann Droneaud
2011-10-19 14:09 ` Yann Droneaud
2011-10-19 14:24   ` Mike Snitzer
2011-10-19 14:37     ` Stuart D. Gathman

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.