[Bug 26982] drm-next/linux-next glxgears CPU usage doubles for 32bit, doesn't on 64bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=26982


Mario Kleiner <mario.kleiner@xxxxxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mario.kleiner@xxxxxxxxxxxxx
                   |                            |.de




--- Comment #1 from Mario Kleiner <mario.kleiner@xxxxxxxxxxxxxxxx>  2011-01-21 19:19:45 ---
Not sure what the reason is, but it's probably not the vblank timestamp or
pageflipping stuff (Disclaimer: I'm the author of the vblank patches). I just
used ftrace on two 32-bit kernel versions:

* The 2.6.37-rc5 kernel (from drm-next) i used to develop and test the patches
- includes the vblank timestamping and radeon kms pageflip patches applied, but
nothing much further.

* The current drm-next kernel snapshot from 10.1.2011, as packaged by Ubuntu
for my Ubuntu 10.10 test system.

I traced with and without pageflipped fullscreen swap, with windowed swap (no
pageflipping) and with graphics idle, but vblank irq's still on.

Test system was a Core2Duo 2.2 Ghz (Apple MacBookPro 2,1) with ATI Mobility
X1600 (RV530). The kms driver takes basically the same path of execution for my
gpu and yours when handling vblank's or pageflips.

Basically all the work of those patches and of the pageflip patches (which
doesn't involve execution of loops or other things with possibly unbounded
execution time), is done in the vblank irq handler, so excessive time spent in
those handlers shouldn't show up in cpu usage of your graphics app, but rather
affect whatever is running on the system. The only interaction with userspace
when scheduling and completing swaps is with the x-server, not direclty with
the client app, so that bits should only show up in X's cpu usage.

ftrace'ing the execution time of the functions in the irq handlers shows less
than 0.1 msecs of time spent per page-flipped swap or vblank irq under graphics
load, less than 0.05 msecs for interaction with userspace (X-server) during
preparation of a pageflip. If you assume a 60 Hz refresh/swap this will end up
using less than 1% cpu on one core for swaps, less than 0.5% when idle with
vblanks turned on.

You could play with various things to see if it changes something:

1. Running the app non-fullscreen (and without desktop compositor), so it
doesn't use pageflipping. Or disable pageflipping in xorg.conf via driver
option: Option "EnablePageFlip" "no", to rule out pageflip related problems.

2. echo 0 > /sys/modules/drm/parameters/timestamp_precision_usec
This will disable almost all cleverness in the vblank timestamping, see if it
makes a change.

Or using ftrace:

cd /sys/kernel/debug/tracing/

echo radeon_crtc_page_flip > set_graph_function
echo function_graph > current_tracer
cat trace_pipe > /tmp/trace.out &
sleep 5 ; echo 1 > tracing_enabled ; sleep 20 ; echo 0 > tracing_enabled
more /tmp/trace.out

-> Gives you execution time of the pageflip ioctl() -- what should account
against x-server's cpu usage.

echo radeon_crtc_handle_flip > set_graph_function
-> Gives you time spent in irq handler for performing the page flip.

echo drm_handle_vblank > set_graph_function
-> Gives you time spent in vblank irq handler for vblank timestamping.

This should all report fairly low numbers (not much more than maybe 100-200
usecs, not the multi-millisecond range needed to create the cpu load you
report).

I don't observe increased cpu load for my test apps, but my x-server, libdrm,
mesa is not at the latest git versions, but somewhere at the state of
november/december last year iirc, so there could be some source of bad
interaction with latest kernel?

thanks,
-mario

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
--
_______________________________________________
Dri-devel mailing list
Dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux