Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2018 10:59:42 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Johannes Lundberg <johalun0@gmail.com>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: Lag after resume culprit found
Message-ID:  <6c53b46c-a0b3-069d-5478-f8480f2177b3@FreeBSD.org>
In-Reply-To: <1cc60c25-c316-cd22-63d5-fc61d66c930a@FreeBSD.org>
References:  <CAECmPwtULDe9GGK0PhnUa7_n=zxripJj9nh5m0RTF9XqKhXKYQ@mail.gmail.com> <acaa419d-891e-96b1-7c1f-3203857c07ec@FreeBSD.org> <CAECmPwsgQhMM6zu=EfV=DQ4VHzEMuQUjD%2B45O-TP=A2U9mM8Qg@mail.gmail.com> <1cc60c25-c316-cd22-63d5-fc61d66c930a@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 17/05/2018 10:56, Andriy Gapon wrote:
> On 17/05/2018 10:46, Johannes Lundberg wrote:
>> On Thu, May 17, 2018 at 7:43 AM, Andriy Gapon <avg@freebsd.org
>> <mailto:avg@freebsd.org>> wrote:
>>
>>     On 17/05/2018 02:07, Johannes Lundberg wrote:
>>     > https://github.com/freebsd/freebsd/commit/66f063557f257baa9c8aeab9f933171eaa6e1cfa
>>     <https://github.com/freebsd/freebsd/commit/66f063557f257baa9c8aeab9f933171eaa6e1cfa>;
>>     > x86 cpususpend_handler: call wbinvd after setting suspend state bits
>>
>>     That's very interesting and surprising.
>>     That commit changes something that happens before suspend, it should not have
>>     any effect on the system state after resume.
>>
>>     Does anyone have a theory of what could be wrong?
>>
>> Nope but moving
>>         CPU_CLR_ATOMIC(cpu, &suspended_cpus);
>> back to the end of that scope fixes it.
> 
> That's interesting.
> Thank you for testing it!
> And let me think about it.

Oh, I am stupid.
I intended that operation to be right after the CPU is done with restoring its
saved context.  Which means that it has to be after fpuresume/npxresume block.
Could you please re-test with CPU_CLR_ATOMIC(cpu, &suspended_cpus) at that position?
And my apologies.

>>     > How to test (i915kms)
>>     >
>>     > Start X with glxgears
>>     > Confirm running stable at 60 fps
>>     > suspend/resume (S3)
>>     > glxgears is now fluctuating between 10-40 fps.
> 


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6c53b46c-a0b3-069d-5478-f8480f2177b3>