Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel and SSD
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 507

PostPosted: Tue Jan 28, 2020 9:32 pm    Post subject: Kernel and SSD Reply with quote

Hi all,
I have just installed gentoo on my Thinkpad w541 with 2 SSDs:
- Samsung PM871: / and xfs
- Crucial 480M: /media/Backup and xfs
- kernel 5.5.0 and 5.4.15

I noticed that dmesg returns:
Code:

[    0.818131] hdaudio hdaudioC1D0: Unable to bind the codec
[    0.957283] ata6: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    0.957328] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    0.957707] ata6.00: LPM support broken, forcing max_power
[    0.959007] ata6.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[    0.959012] ata6.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[    0.959075] ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[    0.959081] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[    0.959391] ata1.00: supports DRM functions and may not be fully accessible
[    0.959405] ata6.00: supports DRM functions and may not be fully accessible
[    0.959568] ata6.00: READ LOG DMA EXT failed, trying PIO
[    0.960150] ata1.00: ATA-9: SAMSUNG MZ7LN256HCHP-000L7, EMT03L6Q, max UDMA/133
[    0.960155] ata1.00: 500118192 sectors, multi 1: LBA48 NCQ (depth 32), AA
[    0.961596] ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[    0.961601] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[    0.961842] ata1.00: supports DRM functions and may not be fully accessible
[    0.963483] ata1.00: configured for UDMA/133
[    0.965622] ata6.00: disabling queued TRIM support
[    0.965626] ata6.00: ATA-9: Crucial_CT480M500SSD1, MU05, max UDMA/133
[    0.965630] ata6.00: 937703088 sectors, multi 16: LBA48 NCQ (depth 32), AA
[    0.979642] ata6.00: LPM support broken, forcing max_power

as you can see there is "READ LOG DMA EXT failed, trying PIO" for the PM871.

So I started to wonder if I may have a kernel config problem.

The write speed seems to be quite slow:
- PM871
Code:

$ dd if=/dev/zero of=output bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.97787 s, 270 MB/s

- Crucial 480M
Code:

$ dd if=/dev/zero of=output bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.84548 s, 377 MB/s


I was expecting something around 500 MB/s, also the Crucial is faster than the PM871.

What can I check?


Thanks
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2650
Location: Canada

PostPosted: Wed Jan 29, 2020 12:27 am    Post subject: Reply with quote

Isn't "READ LOG DMA EXT failed, trying PIO" actually for your Crucial drive (ata6.00) while Samsung is on ata1.00 ?
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2650
Location: Canada

PostPosted: Wed Jan 29, 2020 12:32 am    Post subject: Reply with quote

Also Crucial has TRIM support disabled, could it make it faster ? And I need to recall what multi=1 for Samsung versus multi=16 for Crucial means
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 507

PostPosted: Wed Jan 29, 2020 12:10 pm    Post subject: Reply with quote

dmpogo wrote:
Isn't "READ LOG DMA EXT failed, trying PIO" actually for your Crucial drive (ata6.00) while Samsung is on ata1.00 ?


Very well spotted, so it makes the performance difference even worst.
I will double check my fstab to understand why TRIM is disabled for Crucial and not for Samsung

Thanks
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 507

PostPosted: Wed Jan 29, 2020 9:35 pm    Post subject: Reply with quote

Here is my fstab:

Code:
i
/dev/sda1 /             xfs     defaults                 0 1
/dev/sdb1 /media/Backup xfs     defaults                 0 1
tmpfs     /tmp          tmpfs   rw,nodev,nosuid,size=12G 0 0


Also I have an fstrim service:
Code:

$ cat /etc/systemd/system/fstrim.service
[Unit]
Description=Run fstrim on all mounted devices that support discard

[Service]
Type=oneshot
ExecStart=/bin/sh -c '/sbin/fstrim --all'

$ cat /etc/systemd/system/fstrim.timer
[Unit]
Description=Run fstrim.service weekly

[Timer]
OnCalendar=weekly
Persistent=true

[Install]
WantedBy=multi-user.target


But I do not understand why trim should be enable on only one.[/profile]
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2650
Location: Canada

PostPosted: Thu Jan 30, 2020 4:21 am    Post subject: Reply with quote

Dmesg message describe events long before any mounting is attempted. Should have nothing to do with fstab or trim services. Essentially, kernel did not detect that Crucial support trim. Does it ?
How old is this model ?
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 507

PostPosted: Thu Jan 30, 2020 9:15 pm    Post subject: Reply with quote

Code:

$lsblk --discard
NAME   DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda           0      512B       2G         0
└─sda1        0      512B       2G         0
sdb           0        4K       2G         0
└─sdb1        0        4K       2G         0


seems to indicate that trim is enabled.

Anything else that I can check?
Back to top
View user's profile Send private message
molletts
n00b
n00b


Joined: 16 Feb 2013
Posts: 47

PostPosted: Thu Jan 30, 2020 10:02 pm    Post subject: Reply with quote

The kernel isn't saying that TRIM isn't enabled at all, it's simply saying that it can't queue TRIM commands. This is likely to be a firmware-related issue with the drive. (There's actually a blacklist of drives with problems in drivers/ata/libata-core.c - the 480GB+ M500 drives are listed as having problems with both queued TRIM and link power management so both functions are disabled on them.)

So when the kernel needs to send a TRIM command, it has to wait for the drive's command queue to be empty, then send the TRIM, then wait for it to complete before sending any other commands, rather than simply submitting it into the queue with all the other commands for the drive to do at its own convenience.

TRIM has historically been a little bit troublesome so it's probably not surprising that there are still drives around with quirks.
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 507

PostPosted: Thu Jan 30, 2020 10:04 pm    Post subject: Reply with quote

Ok.
Even forcing a trim with fstrim -v / and fstrim -v /media/Backup did not change the performance
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4399
Location: Dallas area

PostPosted: Thu Jan 30, 2020 10:25 pm    Post subject: Reply with quote

Samsung PM871 -- 540 MBps (read) / 280 MBps (write)

The Crucial is more like 500/400, so looks like your original post they're working fine.
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 507

PostPosted: Fri Jan 31, 2020 8:19 am    Post subject: Reply with quote

Ohh. That make it a no problem.

Thank you very much for the information
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum