Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp890198ybt; Tue, 7 Jul 2020 02:49:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT9KIANsfb3Xv/zqSfNqKlh5mYeRC4d2vCIYlJ6JEWn4A97IFdYQiuWCaPfIJ3qms3wC+Y X-Received: by 2002:a17:906:c14f:: with SMTP id dp15mr46924682ejc.454.1594115365536; Tue, 07 Jul 2020 02:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594115365; cv=none; d=google.com; s=arc-20160816; b=hjqowC484t8AX690STRcDBup6D84VMu6LsEdoQKWITNP0Vb/+gb+EmKH/K5jBpIdoL bcjWxUt4IxIhypi2Xhqzw80twJkl3ucTKGDxr+45UXSyzWy1vt4hvW2re9X6nlJOvbRE oCG4O9tg9gPL8U2EIkh/opaKzPynEen2H9ork6KOLhr1emGNUC2tJiojM5XWC6an0a9q +KBOB2lBXKJstcjtNSwNnAt0rd5E60bU5EWK3DsV1ss9f3zFVck6JEIv1nwAqAxVyfqz 1aa1H5oom8b1QrSmvil6okjZGwZB7wPRNPVPkSGhBmqbBChE5IVK9zXnCQtGoAF7yNfF XhPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+xhE09FSIbPBUcO2BhFd1zwZ423fLcZ/JnwL1A6q3qQ=; b=ogOj6tDBSgH+ovQqx0S1Srs79WXaIWxw7xdv3+MpZQQyBdmboI0B5Ig3OddfFdYnIE V37DZRLU2M54LpxlUnEkSKdVmhxKRtNftPi8SjfAahSZV7JYq5yI72pxA1V2BdjRp0Q5 sgP8suedHwzwaneq0teDcMqCnhSMqnw3taLToVGL1hZ1F1z1gG1fXr2lsOjwAeJsReeI EUsqGd5pdEdadB2oVOVFJBWMRx3tPZX1E1SvnyUXe+mcJOARgjxclvyMHb32FuDMVQVY jaKDupTTps3Kxp48Kn4RWEW2IF7d1k92wA7QDjFALWSEt3e9vnTWJmnCczqmpcNYPwpw 1ZpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZkMiEYwE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci26si13703921ejc.715.2020.07.07.02.49.01; Tue, 07 Jul 2020 02:49:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZkMiEYwE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728210AbgGGJrf (ORCPT + 99 others); Tue, 7 Jul 2020 05:47:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728206AbgGGJre (ORCPT ); Tue, 7 Jul 2020 05:47:34 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF3C1C08C5DB for ; Tue, 7 Jul 2020 02:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+xhE09FSIbPBUcO2BhFd1zwZ423fLcZ/JnwL1A6q3qQ=; b=ZkMiEYwE0mC2aCwnAqI59DykQT W8za/eywlDbaja6MUe6ygYX3We8vIJ5zBZbsYUml2MUcV03UCMbJU/MEF/KMhZA6HPtF/fY04LJ// I01/ROLsmmhMxHbHaWl7zTSCtd2SUKKpESOiawAd1JD1BU0rSULNPjO7w6lHfkq2oHAMjU0ZItEFl 0y8QLTEjI+w4+jIN1cb8n0WJF6i7GGfEeEMLRHO6rNCLtYHEybMbf+PjXm9wpobPEP1U/OlfYM8BS P6z+IhOjGcv9XQqFHJxScQ+U+XzKTgakmFX1SwXjZMQybCKu6ss09VXTmk+0MXFTs+Ck6xDaTmmUn us4rn3bQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jskCA-0001OE-D3; Tue, 07 Jul 2020 09:47:22 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6F9C2304B90; Tue, 7 Jul 2020 11:47:18 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3711B213C912A; Tue, 7 Jul 2020 11:47:18 +0200 (CEST) Date: Tue, 7 Jul 2020 11:47:18 +0200 From: Peter Zijlstra To: Qais Yousef Cc: Dave Jones , Mel Gorman , Linux Kernel , mingo@kernel.org, Linus Torvalds , paul.gortmaker@windriver.com, valentin.schneider@arm.com Subject: Re: weird loadavg on idle machine post 5.7 Message-ID: <20200707094718.GL4800@hirez.programming.kicks-ass.net> References: <20200702171548.GA11813@codemonkey.org.uk> <20200702213627.GF3183@techsingularity.net> <20200703090226.GV4800@hirez.programming.kicks-ass.net> <20200703104033.GK117543@hirez.programming.kicks-ass.net> <20200703205153.GA19901@codemonkey.org.uk> <20200706145952.GB597537@hirez.programming.kicks-ass.net> <20200707092004.jviycpvzb4l5ytiz@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707092004.jviycpvzb4l5ytiz@e107158-lin.cambridge.arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 07, 2020 at 10:20:05AM +0100, Qais Yousef wrote: > On 07/06/20 16:59, Peter Zijlstra wrote: > > + if (!preempt && prev_state && prev_state == prev->state) { > > I think the compiler won't optimize `prev_state == prev->state` out because of > the smp_mb__after_spinlock() which implies a compiler barrier. Still not sure > if it's worth making prev->state accesses a READ_ONCE()? task_struct::state is one of the very rare (and ancient) variables that's declared volatile. We should probably clean that up some day, but so far I've not attempted to do such a thing.