mouse scroll stucks at high cpu load

Dear all.

    Some weeks ago, within Leap15.1, my touchpad and mouse started    to behave crazily when my laptop is at high cpu usage.

    I then installed a brand new Leap15.3, problem persisted, then I    made a hardware disconnection of the touchpad and now the most    emerging symptom is that the mouse wheel scrolling stucks when my 8 cpu's are    at full usage (I make huge calculations within it). That happens    "sligthly" even when I load a heavy internet page (with all    background videos running...). When I kill the cpu demanding  processes, the mouse    behavior normalizes after more or less time.

    I am not sure this is a hardware problem, one hypothesis I    consider is that for some reason priority for event handling is    messed up. Nevertheless, I should say the same behavior happens at    booting this laptop with windows10 (furmark allowed me to test    this).

    Other facts that might help an appreciation:

1) This is a Lenovo Ideapad P400, + - 2 y. ago the original HD wore    out and I changed it for a 960 GB SSD.  I also made a recent RAM    upgrade form 8 GB to 16 GB.

2) The touchscreen has also been hardware disabled, but several    years ago.

3) After one previous opensuse update (I cannot recall versions),    screen brightness could not be controlled. This was overcome when I    added “acpi_backlight=video” as a parameter for "GRUB_CMDLINE_LINUX_DEFAULT=“        in /etc/default/grub; curiously this allows me to control brightness at linux , but not at windows, where the screen keeps at + - half    the brightness. For some reason I have two EFI partitions in my SSD,    I think the first was created when I installed windows, then, linux.

4) At a cooler fan replacement, I could not get back fan speed    control (acc. to cpu load), so the fan is always at maximum speed    (not a big issue because most of the time all the 8 cpu' s are    full). I could not find how to sort this out yet.

    Is it possible that the problem I see is software/configuration    related? Where should I look at?

    Thank you,



Jorge

You may restrict CPU-intensive task for using only part of CPU kernels - 6 for it, others 2 being reserved for OS and another tasks.
Of course, it is better to use desktop/server, not laptop for heavy load.

Thanks. This might be a palliative. Nevertheless, significant delays on mouse happen even when few cpu’s are fully active (as I stated, some heavy internet pages loaded). Formerly, I could use mouse, etc., any other peripheral with all cpu’ s at full speed without problem. Even if nice is set to 0 for the demanding processes.
I cannot, nevertheless, nail out exactly when this started to happen (some update, etc.).

Are you short of RAM? Linux becomes very sluggish if it gets into substantial swapping. You could run the free command to find out, or perhaps run top or any monitoring utility of you choice.

Thanks mchnz for your input. Good thinking. I recently upgraded to 16 GB RAM; the program I have been using (a quantum mechanics program by the way) is computer intensive, but does not requires much RAM. I am used to “System Monitor” to see resource enrollment.

I thought I’d see if I could make my own system unresponsive due to CPU activity. As a normal user I ran stress-ng to simulate load:

**%** stress-ng --class cpu --all 6

This certainly results in an unresponsive desktop, the mouse appears to be OK, but there are considerable delays in switching window focus, window surfacing, and switching browser tabs:

If I nice +19 then the desktop just feels a little slower than normal but still quite responsive:

**%** nice -n 19 stress-ng --class cpu --all 6

My system is quite old, so my experience with the above stress-ng parameters is unlikely to match your own (AMD FX-6300, 16GB, SSD root, SSD home, GTX-1650 Super, OpenSUSE Tumbleweed).

You could perhaps use stress-ng to match something like you own situation (I got stress-ng from my OpenSUSE OSS repo). Then you could ask here for further advice with your stress-ng test case. Stress-ng’s options for simulating various classes of stress seem quite comprehensive:

**--class name**
              specify the class of stressors to run. Stressors are classified into one or more of  the  following  classes:  cpu,  cpu-cache,  device,  io,  interrupt,
              filesystem,  memory,  network,  os,  pipe, scheduler and vm.  Some stressors fall into just one class. For example the 'get' stressor is just in the 'os'
              class. Other stressors fall into more than one class, for example, the 'lsearch' stressor falls into the 'cpu', 'cpu-cache' and 'memory'  classes  as  it
              exercises all these three.  Selecting a specific class will run all the stressors that fall into that class only when run with the --sequential option.

              Specifying a name followed by a question mark (for example --class vm?) will print out all the stressors in that specific class.

OK, I installed stress-ng (thanks for letting me know of this tool).

Initially, the tests you mentioned:

!!!
> stress-ng --class cpu --all 8
this ocuppies all 8 cpu’s at 100 %
System gets slow , but I can my navigate between windows and even mouse scroll works, some delay, but works.
What I observed to be most slowed down is to move between tabs, e.g, in either “System Monitor” or google-chrome

running at nice 19
> nice -n 19 stress-ng --class cpu --all 8
There is less delay. Mouse scrolling and tab change still seem to be the most suffering operations, but less.

So far, it seems + - like you see in your system.

!!!

Now, going systematically to the list of classes:

!!!
> stress-ng --class cpu-cache --all 8
the same as for --class cpu

> stress-ng --class device --all 8
Practically no effrect on the system. Exception is tab change and mouse scrolling in only “System Monitor”, but after some seconds, I get these events

> stress-ng --class io --all 8
Practically no effect on the system. Exception is tab change and mouse scrolling in only “System Monitor”, but after some seconds, I get these events

> stress-ng --class interrupt --all 8
Yes, this does harm the system, mouse barely moves and scrooling is impossible. I could hardly get to the terminal where the command was issued and set a ctrl-c ; after some minutes, system normal functioning returned.

> stress-ng --class filesystem --all 8
the same as for --class cpu; just a little slower concerning tab change and mouse scrolling.

> stress-ng --class memory --all 8
This completely frooze my system; I had to switch off to get back to it.

> stress-ng --class network --all 8
the same as for --class cpu

> stress-ng --class os --all 8
This completely frooze my system; except the mouse pointer barely moved. I had to power down the system

> stress-ng --class pipe --all 8
System got sluggish, mouse scrolling unavailable, it cost me somewhow but I managed to get into the terminal and issue a ctrl-c

> stress-ng --class scheduler --all 8
This almost completely froze the system, I could barely move the mouse pointer, but clicks did not seem to work. I had to power down the system.

> stress-ng --class vm --all 8
This completely frooze my system; except the mouse pointer barely moved. I had to power down the system

!!!

I would be ready to run other tests, should them help.

When I wrote “*You could perhaps use stress-ng to match something like you own situation”, *I meant that you might be able to consider what your “quantum mechanics program” is doing and create a similar situation with stress-ng, then others might be able to suggest ways to throttle access to the appropriate resources. Running the entire set of stress-ng classes doesn’t really tell us much about what your program is doing.

So… what is you program doing? Lots of interprocess communication, straight CPU, CPU-cache access, lots of IO?

You seem to state things used to run OK, and now they don’t, perhaps a general check of system health might be in order. You could check for unusual messages in the dmesg output or journalctrl --boot. As I understand it many laptops wind up throttling the CPU’s when they get too hot under load - have you monitored the CPU/system temperatures and fan speeds? (KSysGuard System-Monitor can plot Hardware Sensors sensor/fan data, plus there is the sensors command.) Is there enough free disk/SSD space?

In terms of monitoring, there are tools like atop (uses color+flashing to highlight high use) and htop - but interpreting the stats is a bit of an art.

For what it’s worth I run my backups nice and also ionice -c 3.

Intensive compute task may use GPGPU - then dedicate 1 GPU for DE desktop effects, or disable desktop effects.

Thanks mchnz and Svyatko for more advices.

I see there are a number of examinations I must do to help on diagnosis. I took some time of today to carry some of them on. I should take more time to answer properly many of the questions, sorry, but I am trying to advance. To detail more, the quantum mechanics (or quantum chemistry, if one prefers) program is named orca and I getting to know what resources are used by the specific calculations I am performing. I went to test other cpu intensive programs; as this is a new linux installation, I must also install software again as well. Now I compiling a molecular dynamics program; this compilation requires only one cpu and even with this limited load the same problem of “no middle button scrolling” happens.

I then plugged a second mouse into other USB port; curiously, it worked nicely, even with its scroll wheel. The first mouse kept working fine except scrolling, the second mouse worked all fine. Then I unplugged the first mouse, what made the second mouse behave weirdly, specially, it seems to output mouse clicks (left button or middle button - in which case it delivers previously captured text wherever the point sits in) automatically or probably when I start to move it. I do not know much about USB buses, but it seems something is interfering with the other. Eventually, my (USB) keyboard stops working and a simple unplug and plug again recovers all functioning.

I will keep making tests and I know that I have an extensive list to read and to do. I just wanted to advance these new observations.

J.

Dear friends,

As far as possible, I kept studying tests to analyse what happens to the laptop. On Sunday, I noticed that a number of times the laptop entered a battery source mode though the cable was kept plugged in (in fact this sometimes happened, but just occasionally). That made me think what a deficient power source might do to the laptop. I just changed it to another source and, for while, the problem seems to be corrected. At least, up to the testes performed until now. Though I can’t still state 100% this is the problem, it seems to be the right hypothesis. I spent much time trying to devise what was happening to the laptop; I do thank you for all your input, which made me know of a number of tools to investigate problems alike.
Now, I would like to keep solving the (less serious and last) other problem it has , which is the fan cooler to be at 100% speed even at basal work. I think this is one problem that must concern configuration and acpi. But maybe I had better start a new topic, no? I previously mentioned it here because I thought it might be related to the mouse scroll problem.

J.