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 B7CC0C61DD8 for ; Mon, 16 Nov 2020 13:00:16 +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 30E8E2223D for ; Mon, 16 Nov 2020 13:00: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="QPhRCZaL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30E8E2223D 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=UcoRVW1RimcT8uTTpBh6Euhce8SWW7kye3eyRx9on5g=; b=QPhRCZaLF8qfIF5G5clGJzMdl Idua11zte7K+lI5AVJld9iBhQdG3CyK1pt7ObSSwp+Dxx6RHOsonVehy8/pVnvxnKFhFvJ0Ww84QV cvumSqb9hmkSKYIaI2lrJJP9DS4wp87xSeU8hg9E5i73QqIoBLFJw0IAGWGDQ+9+kVjmB+yNNCyyZ myY6FWISnRBU0ipUa+eoDYrAflGKuOQDQTZCvXEqLf3Nb9B9zt3SA1ndpH60wLsnMaLA5qfo8jsGS 6Wk09EXRc4ZixYCg5rGTYjjTmSNxEr6J5pERcYxWflQNQD7K4kksV3edKWO/0T/4OsKrA9uUDStef /SduE117g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kee5Z-0004Z5-UD; Mon, 16 Nov 2020 12:58:34 +0000 Received: from outbound-smtp24.blacknight.com ([81.17.249.192]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kee5H-0004RE-Ex for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 12:58:18 +0000 Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp24.blacknight.com (Postfix) with ESMTPS id 7AB62C0DEA for ; Mon, 16 Nov 2020 12:58:12 +0000 (GMT) Received: (qmail 17723 invoked from network); 16 Nov 2020 12:58:12 -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:58:11 -0000 Date: Mon, 16 Nov 2020 12:58:09 +0000 From: Mel Gorman To: Peter Zijlstra Subject: Re: Loadavg accounting error on arm64 Message-ID: <20201116125809.GP3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> <20201116124657.GA3121392@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201116124657.GA3121392@hirez.programming.kicks-ass.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_075815_643674_43AD9018 X-CRM114-Status: GOOD ( 16.08 ) 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 , Will Deacon , 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 01:46:57PM +0100, Peter Zijlstra wrote: > On Mon, Nov 16, 2020 at 09:10:54AM +0000, Mel Gorman wrote: > > Similarly, it's not clear why the arm64 implementation > > does not call smp_acquire__after_ctrl_dep in the smp_load_acquire > > implementation. Even when it was introduced, the arm64 implementation > > differed significantly from the arm implementation in terms of what > > barriers it used for non-obvious reasons. > > This is because ARM64's smp_cond_load_acquire() implementation uses > smp_load_aquire() directly, as opposed to the generic version that uses > READ_ONCE(). > > This is because ARM64 has a load-acquire instruction, which is highly > optimized, and generally considered cheaper than the smp_rmb() from > smp_acquire__after_ctrl_dep(). > > Or so I've been led to believe. Fair enough. Either way, barriering sched_contributes_to_load "works" but it's clumsy and may not be guaranteed to be correct. The bits should have been protected by the rq lock but sched_remote_wakeup updates outside of the lock which might be leading to the adject fields (like sched_contributes_to_load) getting corrupted as per the "anti guarantees" in memory-barriers.txt. The rq lock could be conditionally acquired __ttwu_queue_wakelist for WF_MIGRATED and explicitly cleared in sched_ttwu_pending (not tested if this works) but it would also suck to acquire a remote lock when that's what we're explicitly trying to avoid in that path. -- Mel Gorman SUSE Labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel