Lenovo T490 Laptop Tuning issues

More
4 days 5 hours ago #350512 by CNCJIM
This Lenovo Laptop is a 4 core  i5 8650 with hyper threading disabled and most of the I/O.  I was able to get the latency down to 1.4ms  for the Servo Thread and 2.5ms for the Base Thread, by manually tweaking the Grub default command line and adding a service to start at runtime to control the fans and power level.    But with this result.  Is the latency withing bounds of running a Mesa 7i96S without issue.  I have disabled all of the I/O except for  the USB  and disk drive.   I had to change the SSD from a NVME M.2  to an SATA III, m.w , Because interrupts were showing up for nvme0q4 causing issues.   Evidenlty all cpu's have these interrupt queues by default and nothing can be done to reassign them. 

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=0 fbcon=blank:0  nvme.io_queues=2 isolcpus=managed_irq,domain,3 nohz=on nohz_full=3 rcu_nocbs=3 processor.max_cstate=1 pcie_aspm=off rqaffinity=0,1,2 kthread_cpus=0,1,2  ipv6.disable=1 i915.enable_dc=0 i915.enable_fbc=0 i915.enable_psr=0 i915.enable_rc6=0 intel_idle.max_cstate=1 intel_pstate=disable skew_tick=1 mitigations=off nosmt nosoftlockup nowatchdog  nvme_core.default_ps_max_latency_us=0 usbcore.autosuspend=-1"
GRUB_CMDLINE_LINUX=""

I did not run rt_setup.sh  -  because I see no history in the header about the package and its uipdate.   I do not know the vintage of the file. 

Please Log in or Create an account to join the conversation.

More
3 days 16 hours ago #350526 by rodw
I think you mean usec not ms. Can you share a screen dump of
latency-histogram --nobase --sbins 1000 --show

Also we need to know the NIC you are using
realtek needs the dkms driver, Intel needs coalescing disabling per man hm2_eth

I suspect its probably OK. IRQ affinity probably needs to be set on startup as it does not persist.

 

Please Log in or Create an account to join the conversation.

More
3 days 15 hours ago #350528 by tommylight
1. you do not need a base period/thread on a laptop
2. disable hyperthreading, TPM, secure boot
3. download the 2.9.9 and 2.8.4 ISO from the downloads page
4. boot from them, without installing, create a config for Mesa 7i96S
5. power on the Mesa 7i96S and wire it to laptop
6. run the config, run some gcode included and see if the connection drops
2.8.4 should be better on that CPU, but either way you look at it, gen 8 Intel are not good, they had to much power saving stuff included that causes huge delays.
I have a ThinkPad E580 with 4 core 8250 intel, it can be used with Mesa for testing, but not on a production machine.
6th gen CPU's were better for this, like 6300, but dual cores are getting to slow for new operating systems.
Here are some tested laptops:
forum.linuxcnc.org/18-computer/54369-use...mesa-ethernet-boards

Please Log in or Create an account to join the conversation.

More
3 days 1 hour ago #350543 by CNCJIM
The latency-histogram is not a good one -   It is from today after I turned on the wifi adapter and Thunderbird driver.   I had those shut off and the Ethernet as well in the Bios along with SD card io  -   I will recapture and start again with the drivers disabled -  root@t490:/home/mylinux# lspci -nnk | grep -iE "Ethernet|WiFi"
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (6) I219-LM [8086:15bd] (rev 30)
root@t490:/home/mylinux# 
So those are the controllers - but the Intel Ethernet module is not loaded.  

The power has been throttled back on each boot via a service .  root@t490:/home/mylinux# cat /usr/local/bin/cnc-bench-init.sh 
#!/bin/bash
# Enable thinkpad_acpi fan control and lock to Level 7
echo "level 7" > /proc/acpi/ibm/fan

# Lock Intel RAPL sustained power limit to 15W (15,000,000 uW)
echo 15000000 > /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw

---  Where the default power is 25W   or 25000000  
The /etc/systemd/system/cnc-bench-init.service   -has to be created to get a systemctl  enable cnc-bench-init-service
to start at run time.      
oot@t490:/home/mylinux# systemctl status cnc-bench-init.service
○ cnc-bench-init.service - LinuxCNC Test Bench Power & Thermal Initialization
     Loaded: loaded (/etc/systemd/system/cnc-bench-init.service; enabled; preset: enabled)
     Active: inactive (dead) since Thu 2026-10-29 13:03:28 MDT; 1h 3min ago
 Invocation: e7cfed2c425b41528e32b456cbcf7ef6
   Main PID: 1019 (code=exited, status=0/SUCCESS)
   Mem peak: 1.8M
        CPU: 7ms

Oct 29 13:03:28 t490 systemd[1]: Starting cnc-bench-init.service - LinuxCNC Test Bench Power & Thermal Initialization...
Oct 29 13:03:28 t490 systemd[1]: cnc-bench-init.service: Deactivated successfully.
Oct 29 13:03:28 t490 systemd[1]: Finished cnc-bench-init.service - LinuxCNC Test Bench Power & Thermal Initialization.
root@t490:/home/mylinux# cat /etc/systemd/system/cnc-bench-init.service
[Unit]
Description=LinuxCNC Test Bench Power & Thermal Initialization
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/cnc-bench-init.sh

[Install]
WantedBy=multi-user.target
root@t490:/home/mylinux# -
Summary - I did what I could - from my  Mesa 7i96 settup  there is a watchdog timer that defaults to 5ms -   And I do not know if this watchdog will cover my 1430000ns  servo thread jitter  and the 2500000ns base thread jitter.   
This is after all a laptop -and it has overhead and SMI's that are not completely managed. 
I have a PI400 that is politely running 65us servo thread jitter  and 125us base jitter.  And a Gigabyte B250-4E3 that has an i5-gen 10 with 4 cores/4 threads -  getting 16us servo thread jitter and 97us base thread.  So I have systems I can use with Mesa cards.  So my simple question-  can I run production jobs with this T490 and its 1.4ms and 2.5ms Jitter.  If the answer is no-  so be it.
    
 



 

Please Log in or Create an account to join the conversation.

More
3 days 1 hour ago #350545 by CNCJIM
I have documented most of my prior setup. I will look for the live ISO images on the dowload page - I have a ventoy drive - its an easy thing to do.
so 2.8.4 first then.

Please Log in or Create an account to join the conversation.

More
3 days 32 minutes ago #350548 by tommylight
Code:
latency-histogram --nobase --sbinsize 1000 --show

Please Log in or Create an account to join the conversation.

Time to create page: 0.523 seconds
Powered by Kunena Forum