xmodmap really slow

Alan Hourihane alanh at fairlite.co.uk
Fri Nov 30 13:38:10 UTC 2018


On 30/11/2018 12:18, Olivier Fourdan wrote:
> On Fri, Nov 30, 2018 at 1:06 PM Olivier Fourdan <ofourdan at redhat.com> wrote:
>> On Fri, Nov 30, 2018 at 12:27 PM Alan Hourihane <alanh at fairlite.co.uk> wrote:
>>> Running perf top while it's happening shows this....
>>>
>>>     26.77%  Xorg           [.] ResourceClientBits
>>>     15.09%  Xorg           [.] GrabMatchesSecond
>>>     12.62%  Xorg           [.] DetailSupersedesSecond.isra.1
>>>     12.55%  Xorg           [.] DeletePassiveGrabFromList
>>>      8.83%  Xorg           [.] GrabSupersedesSecond
>>>      5.55%  Xorg           [.] AddPassiveGrabToList
>>>      3.09%  Xorg           [.] DeletePassiveGrab
>>>      2.00%  Xorg           [.] xi2mask_merge
>>>      1.16%  libc-2.27.so   [.] _int_malloc
>>>      0.92%  libc-2.27.so   [.] _int_free
>>>      0.59%  Xorg           [.] XkbSendMap
>>>
>>> Xorg is totally frozen while this is happening. No rendering occurs at all.
>> ResourceClientBits() has a loop, I wonder how many times it gets
>> called for one xmodmap request, but we could probably cache the
>> resulting value since `LimitClients` is not supposed to change once
>> it's set and clients are started, that would save us the loop.
> Please let me know if that patch makes any difference:
>
> https://patchwork.freedesktop.org/series/53315/
>
> If it helps, I'll prepare a MR.

Many thanks for following and providing a patch.

Might take me till Monday, but running....

xmodmap -pke > /tmp/keydump
xmodmap /tmp/keydump

Where the last command invokes multi-second delays should be easy to test.

Alan.



More information about the xorg-devel mailing list