Page 1 of 1

[SOLVED] Samsung SSD 830 Windows 7 slow boot after Mageia 3

PostPosted: Aug 6th, '13, 21:19
by bertaerts
I have a notebook Dell Inspiron 17R SE 7720 on which I installed a Samsung SSD 830 256 GB which is configured in BIOS as AHCI. I use legacy boot (no UEFI) and have installed two OS's: Windows 7 Home Premium 64 bit (NTFS) and linux Mageia 3 x86_64 (ext4). Both were installed from installation media, so no copy of HDD images.

BIOS is latest from Dell support website: version A15.

There is still 43 GB unallocated space for overprovisioning.

Windows 7 has all the latest Dell drivers installed and the latest Samsung Magician 4.1 which is the Samsung SSD configuration tool where the choice for OS optimisation has been set to maximum performance. Magician shows AHCI mode and SATA 6 Gbps speed. Windows boots via MasterBootRecord and Mageia via EasyBCD boot menu.

Some data about my Mageia 3 (updated with all available updates):

I adapted /etc/fstab to have trim enabled and no writing of timestamps on reading files:
Code: Select all
UUID=de54fb3b-313f-41d6-b3e3-db6dd0a929e5 / ext4 defaults,noatime,discard 1 1

Trim is working fine, verified with:
https://sites.google.com/site/lightrush/random-1/checkiftrimonext4isenabledandworking

Partitions are aligned as:
Code: Select all
[root@Dell7720Mageia3 proc]# fdisk -lu /dev/sda

Disk /dev/sda: 256.1 GB, 256060514304 bytes, 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe663567a

Device Boot Start End Blocks Id System
/dev/sda1 2048 102402047 51200000 83 Linux
/dev/sda2 * 102402048 409602047 153600000 7 HPFS/NTFS/exFAT


Both partitions start as a multiple of 2048, so OK.

Now comes my issue...

When booting Windows 7, from powerbutton via BIOS to Windows boot options (with Windows and Mageia) happens within 2 seconds. Booting up to login screen takes from 15 to 17 seconds. This can be repeated. Booting Mageia 3 up to login screen takes 24 to 29 seconds. But once Mageia has been running, the BIOS to boot menu takes 14 seconds and full Windows 7 boot time from power button to login screen takes 63 to 67 seconds. Windows reacts slowly. Mageia after Mageia boot takes 42 to 51 seconds. Mageia does not feel slower. But starting Samsung Magician in Windows 7 and rebooting gives again the fast boots. This is repeatable.

So my questions are : what is Mageia doing with the SSD? What magical trick is Magician doing to restore the fast mode? Why is the BIOS so slow in reading the MBR and showing the boot options? How can I solve this annoying behaviour?

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Aug 17th, '13, 21:48
by bertaerts
A follow up...

In the meantime I did two other things to improve the lifetime of my SSD.

1. Put io scheduler of SSD to deadline, while HDD remains cfq

Code: Select all
[bert@Dell7720Mageia3 ~]$ cat /etc/udev/rules.d/60-schedulers.rules
# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"

# set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"

verified as

Code: Select all
[bert@Dell7720Mageia3 ~]$ cat /sys/block/sda/queue/scheduler
noop [deadline] cfq
[bert@Dell7720Mageia3 ~]$ cat /sys/block/sdb/queue/scheduler
noop deadline [cfq]

See reference https://wiki.archlinux.org/index.php/Solid_State_Drives#Using_udev_for_one_device_or_HDD.2FSSD_mixed_environment

2. tmp in RAM on tmpfs
Code: Select all
cat /etc/fstab
# Entry fot /tmp
tmpfs   /tmp         tmpfs nodev,nosuid,size=2G  0  0

See reference https://wiki.archlinux.org/index.php/Fstab#tmpfs

There is no improvement on the reported issue: after booting Mageia 3, SSD reacts slowly as mentioned in the first post.

Important to mention that this is a Mageia 3 ONLY issue.
The months that I was using Mageia 2 (also x86_64) on the very same hardware, I never saw this issue.

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Sep 1st, '13, 21:35
by bertaerts
Would there be a relation with following error message in dmesg:
Code: Select all
[bert@Dell7720Mageia3 ~]$ dmesg | grep ASPM
[    1.171022] pci 0000:00:01.0: ASPM: Could not configure common clock
[    1.175246]  pci0000:00: ACPI _OSC support notification failed, disabling PCIe ASPM


This is about the PCI Express bus on Intel HM77 chipset: Active State Power Management.

In fact most of the devices, except for the audio device on the HM77 chipset have ASPM enabled according to:
Code: Select all
[root@Dell7720Mageia3 bert]# lspci -vvv | grep ASPM
                LnkCap: Port #2, Speed 8GT/s, Width x16, ASPM L0s L1, Latency L0 <256ns, L1 <8us
                LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
                LnkCap: Port #0, Speed unknown, Width x0, ASPM unknown, Latency L0 <64ns, L1 <1us
                LnkCtl: ASPM Disabled; Disabled- Retrain- CommClk-
                LnkCap: Port #1, Speed 5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <16us
                LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
                LnkCap: Port #5, Speed 5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <16us
                LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
                LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Latency L0 <512ns, L1 <4us
                LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
                LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Latency L0 <512ns, L1 <4us
                LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <4us, L1 <32us
                LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 <64us
                LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+


One other strange observation: after booting and using Mageia 3, using Windows 7 gives every few minutes a click in the speakers, hearable loud and clear in absence of any other sound. These clicks are not present when Windows 7 has booted in the fast mode after having started Samsung Magician in the previous Windows 7 session. Is it coincidence that this audio device is just the one not supporting ASPM in Mageia 3 ?

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Sep 10th, '13, 20:20
by bertaerts
[UPDATE]
Below information is not relevant.
Aida64 is monitoring in realtime all parameters.
The Slow boot values can also be found in the fast boot, it all depends on the time of the snapshot to make the report.
[END UPDATE]

Thanks to AIDA64 on Windows I could see the difference between system configuration/performance from a fast Windows 7 boot versus a Windows 7 boot after Mageia 3 had been running.

Fast boot:

Code: Select all
  [ PCI Express 3.0 x16: nVIDIA GeForce GT 650M (Dell) ]

    Graphics Processor Properties:
      Video Adapter                                     nVIDIA GeForce GT 650M (Dell)
      GPU Code Name                                     GK107M
      PCI Device                                        10DE-0FD1 / 1028-0566  (Rev A2)
      Transistors                                       1300 million
      Process Technology                                28 nm
      Die Size                                          118 mm2
      Bus Type                                          PCI Express 3.0 x16 @ 3.0 x16
      Memory Size                                       2 GB
      GPU Clock                                         745 MHz
      RAMDAC Clock                                      400 MHz
      Pixel Pipelines                                   16
      Texture Mapping Units                             32
      Unified Shaders                                   384  (v5.0)
      DirectX Hardware Support                          DirectX v11.1
      Pixel Fillrate                                    11920 MPixel/s
      Texel Fillrate                                    23840 MTexel/s


Slow boot:

Code: Select all
  [ PCI Express 3.0 x16: nVIDIA GeForce GT 650M (Dell) ]

    Graphics Processor Properties:
      Video Adapter                                     nVIDIA GeForce GT 650M (Dell)
      GPU Code Name                                     GK107M
      PCI Device                                        10DE-0FD1 / 1028-0566  (Rev A2)
      Transistors                                       1300 million
      Process Technology                                28 nm
      Die Size                                          118 mm2
      Bus Type                                          PCI Express 3.0 x16 @ 1.1 x16
      Memory Size                                       2 GB
      GPU Clock                                         135 MHz
      RAMDAC Clock                                      400 MHz
      Pixel Pipelines                                   16
      Texture Mapping Units                             32
      Unified Shaders                                   384  (v5.0)
      DirectX Hardware Support                          DirectX v11.1
      Pixel Fillrate                                    2160 MPixel/s
      Texel Fillrate                                    4320 MTexel/s


The HM77 chipset that controls PCIe seems wrongly configured after Mageia 3.
The graphics processor sees a bus @1.1 iso @3.0.
Clock speeds and pixel fillrates are completely degraded.
The other devices on HM77 will suffer from the same, causing the slow SSD access.

Now my question: how can I get a clean HM77 configuration?
I already tried with boot parameter pcie_aspm=off but that does not make a difference.
I have my own custom kernel to support the Alps touchpad, based on the stock desktop kernel, only replacing 2 source files.
So if you think I could solve my issue with a different kernel config, please let me know!

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Sep 11th, '13, 19:24
by zeebra
Was this an issue when you used another hard drive as well or only after you moved to the SSD disk?

Try
Code: Select all
hdparm -tT /dev/sdX

See what that tells you about your disk performance.

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Sep 11th, '13, 19:50
by bertaerts
There is no issue with the SSD performance as can be seen:

Code: Select all
[root@Dell7720Mageia3 bert]# hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   20980 MB in  2.00 seconds = 10499.41 MB/sec
 Timing buffered disk reads: 1300 MB in  3.00 seconds = 432.83 MB/sec
[root@Dell7720Mageia3 bert]# hdparm -tT /dev/sdb

/dev/sdb:
 Timing cached reads:   21522 MB in  2.00 seconds = 10771.17 MB/sec
 Timing buffered disk reads: 334 MB in  3.01 seconds = 110.91 MB/sec


sda is SSD sdb is HDD.

In the Mageia 2 timeframe, with the same combination of SSD and HDD, there was no issue.
But in the meantime there were some BIOS updates also, on top of the move to Mageia 3.

I don't have the impression that Mageia 3 works slow, only the boot is very slow from BIOS screen to Windows 7 boot manager to choose Mageia 3 or Windows 7 takes 14 seconds.

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Sep 12th, '13, 00:02
by zeebra
I think I don't understand your descriptions correctly. Which boot manager do you use?
I have the impression you don't use GRUB or Lilo. In that case try Grub! And be sure to write it to MBR. I can almost guarantee that will get rid of the problem.

I have Samsung 840 SSD and I have no such strange software that you talk about. Perhaps that is your issue? The simplest solutions are often the best!

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Sep 12th, '13, 22:12
by bertaerts
Hi zeebra, thanks for your suggestion.

But I use grub for Mageia 3 when Windows boot manager from Master Boot Record passes control to sda1.
I don't see why using grub as boot manager on MBR would solve the problem that Windows 7 is very slow after Mageia has been running.

What strange software am I talking about? Samsung Magician? That is Samsung's proprietary tool to manage their SSDs in Windows. Unfortunately they don't have a linux version...

I found:
http://sit1way.wordpress.com/2013/04/11/fixing-buggy-dsdt/
searching further in the direction of the error "ASPM: Could not configure common clock".

When I decompile DSDT I indeed get lot's of errors.
So I think the Dell BIOS A15 is buggy...
But I have no idea of corrections.

Code: Select all
     * iASL Warning: There were 4 external control methods found during
     * disassembly, but additional ACPI tables to resolve these externals
     * were not specified. This resulting disassembler output file may not
     * compile because the disassembler did not know how many arguments
     * to assign to these methods. To specify the tables needed to resolve
     * external control method references, use the one of the following
     * example iASL invocations:
     *     iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>
     *     iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>

Re: Samsung SSD 830 Windows 7 slow boot after Mageia 3 boot

PostPosted: Sep 12th, '13, 22:19
by zeebra
I don't know how the Windows boot manager works, but I would say the issue is almost certainly there.

Re: [SOLVED] Samsung SSD 830 Windows 7 slow boot after Magei

PostPosted: Sep 26th, '13, 20:47
by bertaerts
[SOLVED]

I installed long time ago smartmontools which apparently starts the service smartd.
It is this S.M.A.R.T. daemon that was responsible for the issues listed in this thread.
I stopped it, made it not startable at boot and rebooted.
Issues solved !!!
In Mageia 2 I did not have this issue as smartmontools was not installed.

So it seems that smartd is writing information to the SSD so that it becomes slow.
And Samsung Magician in Windows 7 corrects this information...
Anyone understands what happens here? Why is the daemon writing?

Re: [SOLVED] Samsung SSD 830 Windows 7 slow boot after Magei

PostPosted: Sep 26th, '13, 23:01
by doktor5000
It doesn't write, it only reads the S.M.A.R.T. registers from the harddrive if it's told to, by default every 30minutes.