Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3372097pxb; Mon, 16 Nov 2020 12:49:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6HEropU2HGjPS6VnzQwY/LID118qJc/1czRenOjvp21jJk2lmH/MDNIqwnTAytOi07dEg X-Received: by 2002:a05:6402:2d7:: with SMTP id b23mr16956405edx.196.1605559740431; Mon, 16 Nov 2020 12:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605559740; cv=none; d=google.com; s=arc-20160816; b=WLSqtbiudq4O4UFj/JkOD/Bft2/Z1IKo0s8wMeBCwmhlSO3S0dGas7fEp+d1GaiyUO uSvKUSPwXPBMEPMTP4+YAKpK589djR7tLdba0sGw6OaPxyKEkTpQNjj0j7ivO2fEYZOl LoT6iDUZWDBymM6hn0oHd8w93zfEg+V511/8/uHXG3vszKu6F9a3RFSjfFzaZ2if0k+8 8MHJkTEAVgGUoTF8T4u13NkI03BVvwAXKq+QJobE/Olv0Zs9zlvMBpayH+Xey0uPsKas VFeyI1/j7b3vsNR8oZyQrTwFeWm9rl8LgaCzTvFIBl/93tE/VMUh0TUfkr76uwjjA9au rKmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BrWmXi+UIWo194O2K8hOUFysvidfLAC5/pWTSjDdnnY=; b=nlLQoMo+KFmEUBYrJ1lQp3Zj/+wlEcW8RJBTrwgvkC+beeWivGKwUUBpbXRVrzY2Sh 8Vv7XO89h2nETHaH8rIqQHoF/0UIuwapw4S3/ceYuAOCUWuxbqxrxTl7kyt4WA2cvqkq v/B2lwxhfH+npG2nxz1vNmcq6loTHCEHBtYgHlCtOvSH5UepCtypnsDW1CoKvMLo12mu J4OAasbLC7Mr38kq01ViV/wl2XUm5rLav+A69k/NsbFEsHaSvtRfzxCB9z4HgpUit3R6 uFpcActBpy/+m0MFeV2lbd9Y8HHUJWhw6mRP3XdXI9ie21pYyAZjL0SOE0IwRWVFvvwv K4jA== ARC-Authentication-Results: i=1; mx.google.com; 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 gb34si12393961ejc.68.2020.11.16.12.48.37; Mon, 16 Nov 2020 12:49:00 -0800 (PST) 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; 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 S1732798AbgKPRYs (ORCPT + 99 others); Mon, 16 Nov 2020 12:24:48 -0500 Received: from outbound-smtp57.blacknight.com ([46.22.136.241]:44161 "EHLO outbound-smtp57.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732793AbgKPRYs (ORCPT ); Mon, 16 Nov 2020 12:24:48 -0500 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp57.blacknight.com (Postfix) with ESMTPS id CC399FB14B for ; Mon, 16 Nov 2020 17:24:46 +0000 (GMT) Received: (qmail 1921 invoked from network); 16 Nov 2020 17:24:46 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 16 Nov 2020 17:24:46 -0000 Date: Mon, 16 Nov 2020 17:24:44 +0000 From: Mel Gorman To: Peter Zijlstra Cc: Will Deacon , Davidlohr Bueso , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: Loadavg accounting error on arm64 Message-ID: <20201116172444.GV3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> <20201116114938.GN3371@techsingularity.net> <20201116125355.GB3121392@hirez.programming.kicks-ass.net> <20201116125803.GB3121429@hirez.programming.kicks-ass.net> <20201116152946.GR3371@techsingularity.net> <20201116164928.GF3121392@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20201116164928.GF3121392@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16, 2020 at 05:49:28PM +0100, Peter Zijlstra wrote: > > So while we might be able to avoid a smp_rmb() before the read of > > sched_contributes_to_load and rely on p->on_cpu ordering there, > > we may still need a smp_wmb() after nr_interruptible() increments > > instead of waiting until the smp_store_release() is hit while a task > > is scheduling. That would be a real memory barrier on arm64 and a plain > > compiler barrier on x86-64. > Wish I read this before sending the changelog > I'm mighty confused by your words here; and the patch below. What actual > scenario are you worried about? > The wrong one apparently. Even if the IRQ is released, the IPI would deliver to the CPU that should observe the correct value or take the other path when smp_cond_load_acquire(&p->on_cpu, !VAL) waits for the schedule to finish so I'm now both confused and wondering why smp_wmb made a difference at all. -- Mel Gorman SUSE Labs