Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3029201pxb; Mon, 16 Nov 2020 04:03:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2nSB5+Ysw0c68QJOPsyZceF4YXjo0FDZ2N0jG43/gcNgwjqAIrfcvEVsIUWrpToCC9EwF X-Received: by 2002:a05:6402:229a:: with SMTP id cw26mr15889467edb.271.1605528227724; Mon, 16 Nov 2020 04:03:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605528227; cv=none; d=google.com; s=arc-20160816; b=zeLuV6crqby3J5tbIoT7jFz3FTy+L5mxKkh4fGSqtwH6D2i24VoFXLUdffyc0HWiml WjTO/Is1xQF/eCJv2IR9/S+0c1u8caBAmn2fWrZZXGMEok6w9Orgnj6GTR+uWUd0HTZX CGBfyMshI0N+AaYdnJdG+xXEznMax+ftYeCChMaAILyOiq52CS3EuyT1SglTJnlVykEj gyti/42FOC99viOufiHMSQL9QdnfkrfET3YBY8M+NmC5UMrultZBXcFakZqv3pFfpUZj 7Bdfq+UL36fMk0IG/7/rR51WXuPPF7byrHN/w+Omsuis1WXu1FMAwtwCkFGrPPD8LR3r NJZA== 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=JnmmKJvmt6EOTk7RXVj+4kcp9ANsoXgMCfqmMQkn4Pk=; b=dj3BK2vPafAYZ5tBFPhYJ9Zc9QLH5tXUGDxnToce2+Y4K9H+YAqOe/K5dPYQ7XA/qx KoiYrQoWwFraOGWFtHUQOFFWt9jSqa/M8zVb7bJe3bEGGBVyFQlx4Vuxd2ZgpYPIuW1K ZaPABx2UP7l0LlgZDFqksSdcR22rwBOiuHD2vaum48jPh+kNd8t/TDkhfibhVagqiRzl fTBzUZs6/eKUnHmoJplWjeh4Uc3/51wID0o+W1cazFRrV6fayuLMfN0jM/r4q3/zC5yw 4rvocJJmmpReQHgTTkHYeaKplR+UXjsPGziiceLWtx7Vp5uVmjxSKbB9o7Y9pKjL20qt QjYg== 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 k7si10783024ejp.590.2020.11.16.04.03.22; Mon, 16 Nov 2020 04:03:47 -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 S1728531AbgKPMA0 (ORCPT + 99 others); Mon, 16 Nov 2020 07:00:26 -0500 Received: from outbound-smtp13.blacknight.com ([46.22.139.230]:47129 "EHLO outbound-smtp13.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbgKPMA0 (ORCPT ); Mon, 16 Nov 2020 07:00:26 -0500 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp13.blacknight.com (Postfix) with ESMTPS id BE76D1C43FA for ; Mon, 16 Nov 2020 12:00:24 +0000 (GMT) Received: (qmail 31835 invoked from network); 16 Nov 2020 12:00:24 -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 12:00:24 -0000 Date: Mon, 16 Nov 2020 12:00:22 +0000 From: Mel Gorman To: Peter Zijlstra , Will Deacon Cc: Davidlohr Bueso , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: Loadavg accounting error on arm64 Message-ID: <20201116120022.GO3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> <20201116114938.GN3371@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20201116114938.GN3371@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 11:49:38AM +0000, Mel Gorman wrote: > On Mon, Nov 16, 2020 at 09:10:54AM +0000, Mel Gorman wrote: > > I'll be looking again today to see can I find a mistake in the ordering for > > how sched_contributes_to_load is handled but again, the lack of knowledge > > on the arm64 memory model means I'm a bit stuck and a second set of eyes > > would be nice :( > > > > This morning, it's not particularly clear what orders the visibility of > sched_contributes_to_load exactly like other task fields in the schedule > vs try_to_wake_up paths. I thought the rq lock would have ordered them but > something is clearly off or loadavg would not be getting screwed. It could > be done with an rmb and wmb (testing and hasn't blown up so far) but that's > far too heavy. smp_load_acquire/smp_store_release might be sufficient > on it although less clear if the arm64 gives the necessary guarantees. > And smp_* can't be used anyway because sched_contributes_to_load is a bit field that is not protected with a specific lock so it's "special". -- Mel Gorman SUSE Labs