From owner-freebsd-current@freebsd.org Thu May 17 07:57:42 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFE0FEDC522 for ; Thu, 17 May 2018 07:57:41 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5954A719EF; Thu, 17 May 2018 07:57:41 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id l1-v6so7217645wmb.2; Thu, 17 May 2018 00:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qGXVJvloNb4RWIRd//LxQrUr+v3SkKDFYUM+O4gA+ds=; b=XNAGdoX2+pxCPddIT5y0u/oIgpx0t5X8Z3/+2H7mxypTl7SAnOFe/PBkRIxRSRrlNC V1tldSwMDejCujgkXMW0a5gnT2fgDHvF5uHTCoZ9V8jI/i1MTatiHB4EYTxkTqpqI2Rs NF/iLJ2zdj6kocu0YlVP2+vKLrNpgjwHdcrnCeC/GQ8trX/HAdgV57/ErByPhKIcT8A3 0b0hdhaKJjeyqD2DctpYuzQbV3atnSUzr01juobiLk353AcxnI2889/JUqYppkM9fKuj JRKaV3v1P7O1BvGEzrldH/f9H423ZrJhPPgVYfMdJJbPTJPN8PWO+mPlOU03TpT57Kk1 ox6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qGXVJvloNb4RWIRd//LxQrUr+v3SkKDFYUM+O4gA+ds=; b=LJyb/5OBq5RyrO258xMK/1YG9GYYz/5ryZBmEUaTgCVEZVe5BWPlpxBjv4v1YlZPfZ CGHlJTx56l/Cuz0BP5wuJtZW7sSwEUWFXNG9X6z9evk5N5CMi5cw/BaDnhAoQOsY7MOi yClq398j7n7KJP27/bP/V8Eb82ty4z2F7gW9TveejB00i5QwDt0h1bhmkzm4WXx3sYoT g6JxCpFWy/cYzebj8cTXhvKiIsgIA35DaiBiZTqmvQ96QT2Zu+YHr0Y+bLsilS+FSsEi rQaPt9DOwlSzfhEtmWjSD0U9b0YRX/dNKqkm1NqBey++Xa5EHNLPn9k8QUl/Xq1uWS4K OZ8Q== X-Gm-Message-State: ALKqPwc70Jy4h+Q6jomZflAhDa0rbRVfHPmBs8pnOnkrLadGYCuB4GFJ NsyRdgphIBp1JeXhEwxa5dKuKmKhNB0z3TX2q0zyeA== X-Google-Smtp-Source: AB8JxZrOy5vdyxNHq4aKxuc9345wIzNSQ61TIItMdk0FwudEXvwep+ps56GAKOvXHEzeZLOcVjxebk42TNWIqRdgT00= X-Received: by 2002:a1c:f714:: with SMTP id v20-v6mr1022407wmh.73.1526543860265; Thu, 17 May 2018 00:57:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.146.194 with HTTP; Thu, 17 May 2018 00:56:59 -0700 (PDT) In-Reply-To: References: From: Johannes Lundberg Date: Thu, 17 May 2018 08:56:59 +0100 Message-ID: Subject: Re: Lag after resume culprit found To: Andriy Gapon Cc: freebsd-current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 07:57:42 -0000 On Thu, May 17, 2018 at 8:46 AM, Johannes Lundberg wrote: > > > On Thu, May 17, 2018 at 7:43 AM, Andriy Gapon wrote: > >> On 17/05/2018 02:07, Johannes Lundberg wrote: >> > https://github.com/freebsd/freebsd/commit/66f063557f257baa9c >> 8aeab9f933171eaa6e1cfa >> > 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. > > I did some further testing. Calling CPU_CLR_ATOMIC(cpu, &suspended_cpus); before pmap_init_pat(); is what "breaks" resume. Is this Intel only or this it happen on AMD as well (which this patch was intended for)? >> > 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 >> > >