Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3372678pxb; Mon, 16 Nov 2020 12:50:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWEoaYeuymMpdR9XSp76YvenKN08RpXb9Zb+uZyD5Q+bjkUKg2hOjzn9BVLuobuGjcgb2y X-Received: by 2002:aa7:d954:: with SMTP id l20mr5605509eds.367.1605559816213; Mon, 16 Nov 2020 12:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605559816; cv=none; d=google.com; s=arc-20160816; b=pja1bhUtT9aobAmXOsgleh0njygZUPr/2ZX01HL26w+Sflgm/Is0aKoBnueixLVPyH ecmZ0McIverGWLvUa2BVmuO2JEo9OXJbYkHagAxYXjhLF4NJGkWGjAQ4ruHbDSL/3zx9 xfGaesV7lkTPQzoeNS5R8NiwfPzlxysRL2Y1tSaDk2o3pfjlZfV4I2MhLM1FM3XAzxTK sJexheWunxw5uIodL/PXqi5+nzebYwPURp+CIYMWP250Qmq2u9ecdc254pkl0Tz8CgDM B9o4sAtxEIIBRmY8FnAoJBde341mBcpC5XUj0gTtxQqHYQN5CxAZGZwcWDwfSlVZkWx1 5Hrg== 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 :dkim-signature; bh=PcRdMt7HFZ0J0tWsEpR/qEf0tUs+r7op5nTfwRxqadk=; b=wi/AfbSVvgQxxh0cuTV5roj//NzHsGwRu1LZE//v5lpUvCb0HBRk9gdoHND/M8/HKh cenfIsUTU68rgNsM1d5tSBT5uXQSMWzLhEyDt360ye0kF45h9qL1ykJHJipOGHn9rMBX RIZtjjfwHV5GzKcFLTHRLsnc5WyvOvQRFTjJbC1LcUxs1xyJB9EDSHEzx7WGxJ0mreIF ZSu+L00nKgEW6mVPrDvXuzAnJo0dkn406PWaanx0jLjkPCMcDo4AYLte5tN8HPHqynKJ k1k2vJdHk951tqYYWqZI5GIRfOOCS7p3fl18xa0L+eJZ3ncvf/lxIUo9l6gQ9vCAXtiL UvlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PqmyS1s6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp17si86712ejb.170.2020.11.16.12.49.53; Mon, 16 Nov 2020 12:50:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=PqmyS1s6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387633AbgKPRl0 (ORCPT + 99 others); Mon, 16 Nov 2020 12:41:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:51770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733295AbgKPRlY (ORCPT ); Mon, 16 Nov 2020 12:41:24 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8ED0620575; Mon, 16 Nov 2020 17:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605548484; bh=BUdpGhQR6uvQ1UiDPnz3BIXkl0WyChUt637AGhwILLU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PqmyS1s6Xkb7owRE7Xh7P+XzYqPQ0k/xDZnr3WzJCMvp8brRHsGn4Wfl3rf1RfId1 N7HzSdqDZ6lrzKe1zmYv/R7PkeWA7zJ6YKVIB6TJiHT2D10rxyGsjjYhJjtIuy3v0m 24wvqkbaYM6SorYbYhP3MylRUHPtj65YdjjRhd+I= Date: Mon, 16 Nov 2020 17:41:20 +0000 From: Will Deacon To: Mel Gorman Cc: Peter Zijlstra , Davidlohr Bueso , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: Loadavg accounting error on arm64 Message-ID: <20201116174119.GB30723@willie-the-truck> 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> <20201116172444.GV3371@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201116172444.GV3371@techsingularity.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:24:44PM +0000, Mel Gorman wrote: > 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. Probably still worth trying Peter's hack to pad the bitfields though, as I think that's still a plausible issue (and one which would appear to be fixed by that smp_wmb() too). Will