Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp215625ybg; Tue, 28 Jul 2020 04:15:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR2NhLOBH7TkITdJRfH2bfYBf5r3VWjTUoa0+v5+B05bOtLebnXSmSSlDL57EYXsd6Ggc8 X-Received: by 2002:a17:906:d042:: with SMTP id bo2mr13705921ejb.152.1595934950478; Tue, 28 Jul 2020 04:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595934950; cv=none; d=google.com; s=arc-20160816; b=ndjRnxcTBmGbqv7Q/9pzP0hhjOeIHHKEUGmtCntrNUQFBhJXF6gd85LKOgVOd1tAJW FobiLY9C4H3ry+5c/2bpahaj7LdWPqhCoLNlbY97HKn/sT/gyafdtyCHHB4mQKgKpY55 FHOgoZN7+s0jqtgdDy7WGNjegolAOQ58I2Mgg4cBVhy+N0cZv/w+yDIxBwlsQWaE9Y+o JpB38NNjHMvIP3eF4UjrwAfMGKFWTsP/A42G6KSpf7tdrOFeRAOqKuQGr5TV8XjxPvQH pKXmTYMlhX6wdg6seR3yUTdxJXtv8TzEm1s7jc2sMYLRjb5o+bdLS7AWDVlHNPPo5lG8 pQrg== 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=PA/tyGEWDw6vKLglviCoSjcXo61IZIN6Uwk0RcC9WsI=; b=weMFWUCQts9AEJOy7qpmz8m8Cjl2nS4ANVFSsl4MddOCPw/c1GsWEyYXfiKZkgVUu5 QeeLMMPLqTYS2TMLFvBPyhkqj/RQCJCx+O+Iynee2krYGeIdEjSuSD77IKAfY8AbFAgj mgXqwgZYz5pQZUyTBl0v4tx2KGnRy0+bRUImBO3JVlgefdGpYrrEafEDMsBwHZ7jMZaq zTNs3+9zhkBRxJYpYSHAt/s5zm3hBTwK+8Ciee+tDt4b2stNA3IQrb/F3A7enEqFDlFl 9aiNSUWoAOKjlevuMECmrl4CYqFqpyv3cV0XF8HtZTPNog9TwBQE5jaaLUHVPd4AqALO PRbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="Reko/uz8"; 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 e23si7300923eja.122.2020.07.28.04.15.28; Tue, 28 Jul 2020 04:15:50 -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="Reko/uz8"; 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 S1728971AbgG1LNJ (ORCPT + 99 others); Tue, 28 Jul 2020 07:13:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728699AbgG1LNJ (ORCPT ); Tue, 28 Jul 2020 07:13:09 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54F0EC061794 for ; Tue, 28 Jul 2020 04:13:09 -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=PA/tyGEWDw6vKLglviCoSjcXo61IZIN6Uwk0RcC9WsI=; b=Reko/uz8yJAr/RR8GHuZPaRWeB sbVWUQ/RryMAKaEvyjVw02qYrg1SHdGYlbwhtV31VnkLzsGeigtJHMeeVlR0G+sA6ENcwIBeFp5q9 j/om3venJu7sr6B+rbsmFTKdzTNDZ6mE8w4SDfWcZpBAluG+Gn6BVw/WeOUBOPeC7CAtO1y6rmO0K 0INzjZt5XjAnZyJiweBfJXw3a28O6wQaT35b9+eTDoisoUifYdKrQvAjT6dvrYeo2HwncBC9iW6j2 7ZYPPyQE/zc/8neMUJFnxlZC0vekz8pgNszfoBu7hR6cIiFKJfTN/MAvnKDC9hyWtM1ZciuSN08mk DZsOBIHA==; 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 1k0NXd-0006HL-H8; Tue, 28 Jul 2020 11:13:05 +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 1620430411F; Tue, 28 Jul 2020 13:13:03 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 00A762BE45AF1; Tue, 28 Jul 2020 13:13:02 +0200 (CEST) Date: Tue, 28 Jul 2020 13:13:02 +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: <20200728111302.GV119549@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727152303.GA301827@e120877-lin.cambridge.arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); \ val; }) #define u64_u32_store(name, val) \ do { \ typeof(val) __val = (val); \ name = __val; \ smp_wmb(); \ name##_copy = __val; \ } while (0) #endif