linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Questions about issue_discards
@ 2012-12-06 22:25 CJ Kucera
  2012-12-07  1:29 ` James Downs
  2012-12-07 14:18 ` Mike Snitzer
  0 siblings, 2 replies; 3+ messages in thread
From: CJ Kucera @ 2012-12-06 22:25 UTC (permalink / raw)
  To: linux-lvm

Hello, list!

I've started to play around with SSD drives and was curious about a
couple aspects of the issue_discards configuration option.

1) The lvm.conf comments note that when enabled, it'll still only
(obviously) issue discards to storage which happens to support it.  Is
there a way of querying block devices to find out if they support the
feature?

2) Would a change to the issue_discards parameter be picked up
automatically by the running kernel?  The lvm.conf manpage mentions that
it remembers the timestamp of the file "between commands" and will apply
changes then, but it almost sounds like that'd be mostly for things like
the device scanning list, etc.

Thanks!

-CJ

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

* Re: [linux-lvm] Questions about issue_discards
  2012-12-06 22:25 [linux-lvm] Questions about issue_discards CJ Kucera
@ 2012-12-07  1:29 ` James Downs
  2012-12-07 14:18 ` Mike Snitzer
  1 sibling, 0 replies; 3+ messages in thread
From: James Downs @ 2012-12-07  1:29 UTC (permalink / raw)
  To: LVM general discussion and development


On Dec 6, 2012, at 2:25 PM, CJ Kucera wrote:

> (obviously) issue discards to storage which happens to support it.  Is
> there a way of querying block devices to find out if they support the
> feature?

hdparm -I /dev/DEVICE

is what you're looking for. SSDs support different methods of supporting discards, mostly TRIM.

> 2) Would a change to the issue_discards parameter be picked up
> automatically by the running kernel?  The lvm.conf manpage mentions that

It should be. You can do an lvm dumpconfig to check.

Cheers,
-j

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

* Re: [linux-lvm] Questions about issue_discards
  2012-12-06 22:25 [linux-lvm] Questions about issue_discards CJ Kucera
  2012-12-07  1:29 ` James Downs
@ 2012-12-07 14:18 ` Mike Snitzer
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2012-12-07 14:18 UTC (permalink / raw)
  To: CJ Kucera; +Cc: linux-lvm

On Thu, Dec 06 2012 at  5:25pm -0500,
CJ Kucera <pez@apocalyptech.com> wrote:

> Hello, list!
> 
> I've started to play around with SSD drives and was curious about a
> couple aspects of the issue_discards configuration option.
> 
> 1) The lvm.conf comments note that when enabled, it'll still only
> (obviously) issue discards to storage which happens to support it.  Is
> there a way of querying block devices to find out if they support the
> feature?

lvm will only issue discards if the underlying device has non-zero
discard_granularity and discard_max_bytes, to check:

cat /sys/block/<dev>/queue/discard_granularity
cat /sys/block/<dev>/queue/discard_max_bytes

(replace <dev> accordingly, e.g. sda)

> 2) Would a change to the issue_discards parameter be picked up
> automatically by the running kernel?  The lvm.conf manpage mentions that
> it remembers the timestamp of the file "between commands" and will apply
> changes then, but it almost sounds like that'd be mostly for things like
> the device scanning list, etc.

lvm.conf's issue_discards doesn't have any affect on the kernel (or
underlying device's) discard capabilities.  It only controls whether
discards are issued by lvm for certain lvm operations (like when an LV
is removed).

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

end of thread, other threads:[~2012-12-07 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-06 22:25 [linux-lvm] Questions about issue_discards CJ Kucera
2012-12-07  1:29 ` James Downs
2012-12-07 14:18 ` Mike Snitzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).