Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3525095pxb; Mon, 16 Nov 2020 17:49:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlSBDCNTxPJn4JXsYRR8FuxasrhffFyRi+/b0rkaLAf54lsRqSi3PEiI9e0k1OxY8sYKbC X-Received: by 2002:a17:906:cb2:: with SMTP id k18mr18760204ejh.71.1605577767225; Mon, 16 Nov 2020 17:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605577767; cv=none; d=google.com; s=arc-20160816; b=Clewxp2mfYRLR1DP517bU4JGEAEjgpUMeYWTiIbXGgQnHgMzxHigmFkMGw3XJlBn70 F2Y94rhuRHiVvvx8hxxkbbTtW7E7/PH6RByvM7AYaW5VBAslN/kLQVLE+1KJTjixL7oB ssY1P9ivD1GZEohicAYqwxPcYm4174xQT/v8FuSWhpzpAq9hzxFhd5BK4N0+AWIzvSfc cRTBMY1xhRC/jATKMunY60A2RydB9c5pN/8dXZa7aVnDX2iBW9rJj+cPBCF+UwFjvDTB BmjI0v8nYs/ins8uYZjAZMRPh8nuf71W5mxS96IWZyRzDiVb22vqE9yJZCqHmOd/Dq+0 I8mQ== 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=JPrHi2igiQz9InlcQm5JDeRaloqX2DTjFCxULtpsQC0=; b=ZXhgixunaC7e8kZ/RW1867/rPvlNrlz+fuQiH96MboWl7t1z5KOTN6iiYQrPo7FixX 3AvMoDJa9teJYd2hRjSQtLKaAvw+ow8OUNUC/UwWAfoeOC7JPDs7M02BC5EgaVuiitC4 aZl7EV92deTBZBEwA85DT/2lIZAoOvvOQHerzxZtxtijieHkQ/MMXrFgBW5Qt/IAuJec ZuvZIrIRFjmYXtzk1wYNfDEe88COXjQrYHvP/PxiWCqJfufn3MnnVGF28AFbbh57rz7o eOD6tcDf7SwxfrFVn1jUs/RJeN+bokaYgf1iBbeLX6PBue8vh2+Or5FAz2YzeUQqM1t0 wHqQ== 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 hs8si7919079ejc.600.2020.11.16.17.49.05; Mon, 16 Nov 2020 17:49:27 -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 S1728750AbgKPLtn (ORCPT + 99 others); Mon, 16 Nov 2020 06:49:43 -0500 Received: from outbound-smtp25.blacknight.com ([81.17.249.193]:50520 "EHLO outbound-smtp25.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbgKPLtn (ORCPT ); Mon, 16 Nov 2020 06:49:43 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp25.blacknight.com (Postfix) with ESMTPS id 744CCCAD9D for ; Mon, 16 Nov 2020 11:49:41 +0000 (GMT) Received: (qmail 6441 invoked from network); 16 Nov 2020 11:49:41 -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 11:49:40 -0000 Date: Mon, 16 Nov 2020 11:49:38 +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: <20201116114938.GN3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20201116091054.GL3371@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 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. (This is still at the chucking out ideas as I haven't context switched back in all the memory barrier rules). -- Mel Gorman SUSE Labs