From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E74AC5519F for ; Mon, 16 Nov 2020 11:56:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 985752224B for ; Mon, 16 Nov 2020 11:56:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VuCcAoU3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 985752224B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yfhX4GHT4Sh/mHPpVU1cz8TiwPeAWbpyVXznZYCBcrU=; b=VuCcAoU3rVUarYUKmeLOlifQB 4isWj7kB69Er19FaI0QTVu2QsxCGI6yhLSn4LBGX0MpkYnQ4JnbG5yoppHqtxUoHNA3qgzo+gBOs4 yjHbLwVMUOAD40FUZlFJpXYZI81cxfL6w5XOz397dcZz4pvfhMIJDEAR8EebnOwrNdlyxXdB6Yies Ducz2zLacvvtazXjrvPWX8SQoXuKshCLBDdWhPtwYRSkICYHimEIqZAZF67nasuCYCLyWL1MWoeuc T0zp3eKt8FBXOUcYmf4nkd7xUe9Bl3VayTF7Fp53knSBR7KKV+m+AKA227lDb/Tgeaf7DSqJQMcxh JhYw8lhdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ked13-0002iG-DA; Mon, 16 Nov 2020 11:49:49 +0000 Received: from outbound-smtp14.blacknight.com ([46.22.139.231]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ked10-0002hJ-Sl for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 11:49:47 +0000 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp14.blacknight.com (Postfix) with ESMTPS id 6CBFF1C426E 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 Subject: Re: Loadavg accounting error on arm64 Message-ID: <20201116114938.GN3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201116091054.GL3371@techsingularity.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_064947_019532_04A66287 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Davidlohr Bueso , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94A77C83D57 for ; Mon, 16 Nov 2020 12:38:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71FA320855 for ; Mon, 16 Nov 2020 12:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728932AbgKPLtn (ORCPT ); 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