linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Setting readahead for Logical Volumes via udev
@ 2014-05-19 15:58 David Wittman
  2014-05-20  7:03 ` Peter Rajnoha
  0 siblings, 1 reply; 5+ messages in thread
From: David Wittman @ 2014-05-19 15:58 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1891 bytes --]

Hey all,

I'm having an issue tuning the readahead value for my Logical Volumes via
udev. In short, I'm trying to create a rule that sets the readahead
attribute for each of my Logical Volumes at boot time or upon the creation
of a new volume. udev seems like the perfect place to do this, but for some
reason or another LVM seems to be overriding these settings.

Here's the udev rule I'm using, followed by an example:

```
# cat /etc/udev/rules.d/83-readahead.rules
# Set the readahead on non-spinning disks to 8kb (16 512b sectors)
ACTION=="add", KERNEL=="dm-*", ATTR{queue/rotational}=="0",
ATTR{bdi/read_ahead_kb}="8"

# lvcreate -L 100G data_fioa -n readahead_test
  Logical volume "readahead_test" created

# blockdev --report
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0    107374182400   /dev/dm-0
```

You'll notice above that the readahead is still 256 512-byte sectors. The
same happens upon a reboot of the system. Despite this, I do see
information in logs from udev that it is writing this value:

> udevd-work[4778]: ATTR
'/sys/devices/virtual/block/dm-1/bdi/read_ahead_kb' writing '8'
/etc/udev/rules.d/83-readahead.rules:3

(Note: this is an earlier log entry; I have since disabled debug logging,
so ignore any inconsistencies here)

With all that said, I am quite certain that the udev rules are correct,
because after running `udevadm trigger`, the readahead values are then set
properly:

```
# udevadm trigger
# blockdev --report
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw    16   512  4096          0    107374182400   /dev/dm-0
```

I've tried tweaking a few of the udev specific values in lvm.conf, to no
avail. Any help or suggestions are appreciated. Here are my system details:

Distro: CentOS 6.4
LVM2 version: lvm2-2.02.98-9.el6_4.3.x86_64
udev version: udev-147-2.46.el6_4.2.x86_64

Thanks,

Dave

[-- Attachment #2: Type: text/html, Size: 2613 bytes --]

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

end of thread, other threads:[~2014-05-22 21:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19 15:58 [linux-lvm] Setting readahead for Logical Volumes via udev David Wittman
2014-05-20  7:03 ` Peter Rajnoha
2014-05-20 15:37   ` David Wittman
2014-05-22  7:07     ` Marian Csontos
2014-05-22 21:37       ` David Wittman

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).