Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp249609ybg; Tue, 28 Jul 2020 05:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygiMNNKKJwD5K5I2Lp0eEjUQHYS2hop+38F0EAEmFWwCItr/TI14lu4R/nLtbNfA087312 X-Received: by 2002:a05:6402:2379:: with SMTP id a25mr14764594eda.180.1595938400308; Tue, 28 Jul 2020 05:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595938400; cv=none; d=google.com; s=arc-20160816; b=hrtpYEyhWlWHmL+6cYp8/VGBMIi37dzhLjU4VOv+EbHf98c3bjP26zCZCooDOR6Gvx 7C3uE2oi/EtUmrSZyDc2lw1+HVLS2nGOS3BNHCtRJ0RLY0S1tumCbN/6V1ed8jTBxSrS /RmbF7bLPNrfw0AN6BmAy0BNGSRbzPlYl5HEHxksLyKjxeyVPzJsYrjl0f6xZg5Aj69A qVx+DNDrdcXprFaj2EfqRgYON6i4By3JKXX5B2VEIw6yL+ku5E1//cmrSsgzuUYh+M5f pV+pM3j4h1Z9Wt7kfR0csm+rtE7yM59c1aQeNw76Ysj7eobkM6XubU4ZQsUF2f6O3ux5 2QYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=65mlISD8+bvHJLtdL7W7KVUZ5VfPrEhV6z6gSzVVTg8=; b=QKD+z/QZv8mZuSlVu8Qpxtp5vwm6jhrxopvN+tdLg519Z3I5+NumMX5jZ0TqXI3QKW gJ8GS164ED2Ql7/L/l61TYkqFsPkZx1/7878PwV8dXangHmCF9rZ4RwCqzx44QeZ7RIQ Sq9akD/oQSZWUGU0dHwh6103hEXavE5iiHUoMhABaeS2hVqkfzE72XGxUi66cSqCcb3O 6cAXJ4vjbYI6uXlUteppEUKYK2LX6K3aQd3gpsZY1iI+yqCSyT+XdktblKZfzGTwgoiK 6IKw6xqpSc6jxxBNXgwmYG54A63PX9SEE97Qg/W5pQZYYF5xosHYv1SuFsOJ+YXQlae3 gOLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=aZbV28BZ; 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 y1si7770302edp.472.2020.07.28.05.12.58; Tue, 28 Jul 2020 05:13:20 -0700 (PDT) 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=fail header.i=@infradead.org header.s=casper.20170209 header.b=aZbV28BZ; 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 S1729322AbgG1MAd (ORCPT + 99 others); Tue, 28 Jul 2020 08:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728433AbgG1MAb (ORCPT ); Tue, 28 Jul 2020 08:00:31 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6452DC061794 for ; Tue, 28 Jul 2020 05:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=65mlISD8+bvHJLtdL7W7KVUZ5VfPrEhV6z6gSzVVTg8=; b=aZbV28BZ0X2XqFcpgcOgwDE9V1 jnCH26zniMVRZEZPNUoO3YEbDpWTpogbpz4M+nFohIFIdkB6reqoz5dHcf/OI9+HHLI/qRhFmTQzv I5Rl8DwLavwxMQFgQ3/fXfrBL6G4Xq1NJPF4DcgroIk2fE7ihgBX7M3itN2oxgaDfo/02s4za5NI/ bg6wdWwNVxdTkCChoq5NtIjhElha1Iq4D+UImYv5kPCUfotj//o7CQbrqmodJg8zrpFf2pMQdQqhZ EADDtHECf/P9N+42U2Xc4DuiTzr5ZlrNdcRgWjA6OZehLJVTnaD1gMJszvZhK2sWSAKcsaHwPAxnz fHbgCz4g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0OHU-0000Ru-4I; Tue, 28 Jul 2020 12:00:28 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 36501300238; Tue, 28 Jul 2020 14:00:27 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1A2502BB5575B; Tue, 28 Jul 2020 14:00:27 +0200 (CEST) Date: Tue, 28 Jul 2020 14:00:27 +0200 From: peterz@infradead.org To: Vincent Donnefort Cc: mingo@redhat.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, lukasz.luba@arm.com, valentin.schneider@arm.com Subject: Re: [PATCH] sched/fair: provide u64 read for 32-bits arch helper Message-ID: <20200728120027.GN43129@hirez.programming.kicks-ass.net> References: <1595847564-239957-1-git-send-email-vincent.donnefort@arm.com> <20200727123801.GJ119549@hirez.programming.kicks-ass.net> <20200727152303.GA301827@e120877-lin.cambridge.arm.com> <20200728111302.GV119549@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728111302.GV119549@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 28, 2020 at 01:13:02PM +0200, peterz@infradead.org wrote: > On Mon, Jul 27, 2020 at 04:23:03PM +0100, Vincent Donnefort wrote: > > > For 32-bit architectures, both min_vruntime and last_update_time are using > > similar access. This patch is simply an attempt to unify their usage by > > introducing two macros to rely on when accessing those. At the same time, it > > brings a comment regarding the barriers usage, as per the kernel policy. So > > overall this is just a clean-up without any functional changes. > > Ah, I though there was perhaps the idea to make use of armv7-lpae > instructions. > > Aside of that, I think we need to spend a little time bike-shedding the > API/naming here: > > > +# define u64_32read(val, copy) (val) > > +# define u64_32read_set_copy(val, copy) do { } while (0) > > How about something like: > > #ifdef CONFIG_64BIT > > #define DEFINE_U64_U32(name) u64 name > #define u64_u32_load(name) name > #define u64_u32_store(name, val)name = val > > #else > > #define DEFINE_U64_U32(name) \ > struct { \ > u64 name; \ > u64 name##_copy; \ > } > > #define u64_u32_load(name) \ > ({ \ > u64 val, copy; \ > do { \ > val = name; \ > smb_rmb(); \ > copy = name##_copy; \ > } while (val != copy); \ wrong order there; we should first read _copy and then the regular one of course. > val; > }) > > #define u64_u32_store(name, val) \ > do { \ > typeof(val) __val = (val); \ > name = __val; \ > smp_wmb(); \ > name##_copy = __val; \ > } while (0) > > #endif The other approach is making it a full type and inline functions I suppose.