Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3046049imc; Wed, 13 Mar 2019 07:37:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzifQZ+M7B11sCgANQzQBz4bBesaXhx+hd5AbjNixPgKYBa6tmXFMTYfJSkd3ud3Xw8xcMj X-Received: by 2002:a17:902:728f:: with SMTP id d15mr46297017pll.156.1552487841373; Wed, 13 Mar 2019 07:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552487841; cv=none; d=google.com; s=arc-20160816; b=n6j8uhPbCWY7EYe9vkV9k1FWBXA03sVcHqaO0AL+PCqw4Fp6CIioL0zjYGPMQEnzq7 x1NXuPi9eMiozW6kS+1SUGmaE0de1bFBZMfdY8HxFhq1TOBflGZ4SyGFl9ykxaW5QdoI K43kenmesBDysJ/2fFsLD85ffAGBkn1iLH1k6HXuXgdF8DZHATkEF2GCDi1QiIrSvvTF WJVzSWu9ssWlx9bouNOtdnWzmr1aa+OvAhbIaEFked2eakjWbCqkm/IA0+3jvqjrrAaC uvqJPMI8rIjOzCeBf1FmYM3SkVLluRZEwPgYvhf/jK6McS2azxmlhUJwUWaM2cKi9gjd guwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=pb2LhFbExs3nNra6kNtHd+/OsnC5ydhq5f0Rc0CLgt0=; b=z4avXGoxLKMH9u1oZDK3QICjHcUib5OEEw7VMaSUAuF5Wu8yj8eGgfO4viGMhKrl6e 6cloasi4Y84HDgxXIiAJXpKe7SSUKtSRLsRV2nSV3qNwI6A/UG1wlzNjaaosW/ZjvEDU jON2Zy1F+0J2Jdtg90gfSA8wvec7Bgh1lE1QXxhFttFyf3Q2ROycPwwKBX0IFoipMLzx 0JofWwqPK+3Xg+ZwSt8XP64eP58A8QQdrQMwRcdM97CAzNZqRjYWO6MCmbu4v9PMC4Ww VlbLt3uBrwY1nBQd5BRMKeOvrQRDLw9yhYiBQAobgQNWkaqu/NG6vOqsHzINHuTCvMw6 KI1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q88si10391768pfa.222.2019.03.13.07.37.04; Wed, 13 Mar 2019 07:37:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbfCMOgE (ORCPT + 99 others); Wed, 13 Mar 2019 10:36:04 -0400 Received: from foss.arm.com ([217.140.101.70]:58564 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfCMOgD (ORCPT ); Wed, 13 Mar 2019 10:36:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02F6280D; Wed, 13 Mar 2019 07:36:03 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9FD403F614; Wed, 13 Mar 2019 07:36:01 -0700 (PDT) Date: Wed, 13 Mar 2019 14:35:53 +0000 From: Mark Rutland To: Peter Zijlstra Cc: Arnd Bergmann , Qian Cai , Jason Gunthorpe , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mm/debug: add a cast to u64 for atomic64_read() Message-ID: <20190313143552.GA39315@lakrids.cambridge.arm.com> References: <20190310183051.87303-1-cai@lca.pw> <20190311035815.kq7ftc6vphy6vwen@linux-r8p5> <20190311122100.GF22862@mellanox.com> <1552312822.7087.11.camel@lca.pw> <20190313091844.GA24390@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313091844.GA24390@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 13, 2019 at 10:18:44AM +0100, Peter Zijlstra wrote: > On Mon, Mar 11, 2019 at 03:20:04PM +0100, Arnd Bergmann wrote: > > On Mon, Mar 11, 2019 at 3:00 PM Qian Cai wrote: > > > > > > On Mon, 2019-03-11 at 12:21 +0000, Jason Gunthorpe wrote: > > > > On Sun, Mar 10, 2019 at 08:58:15PM -0700, Davidlohr Bueso wrote: > > > > > On Sun, 10 Mar 2019, Qian Cai wrote: > > > > > > > > Not saying this patch shouldn't go ahead.. > > > > > > > > But is there a special reason the atomic64*'s on ppc don't use the u64 > > > > type like other archs? Seems like a better thing to fix than adding > > > > casts all over the place. > > s64 if anything, atomic stuff is signed (although since we have -fwrapv > it doesn't matter one whit). > > > > A bit of history here, > > > > > > https://patchwork.kernel.org/patch/7344011/#15495901 > > > > Ah, I had already forgotten about that discussion. > > > > At least the atomic_long part we discussed there has been resolved now > > as part of commit b5d47ef9ea5c ("locking/atomics: Switch to generated > > atomic-long"). > > > > Adding Mark Rutland to Cc, maybe he has some ideas of how to use > > the infrastructure he added to use consistent types for atomic64() > > on the remaining 64-bit architectures. > > A quick count shows there's only 5 definitions of atomic64_t in the > tree, it would be trivial to align them on type. > > $ git grep "} atomic64_t" > arch/arc/include/asm/atomic.h:} atomic64_t; > arch/arm/include/asm/atomic.h:} atomic64_t; > arch/x86/include/asm/atomic64_32.h:} atomic64_t; > include/asm-generic/atomic64.h:} atomic64_t; > include/linux/types.h:} atomic64_t; > > Note that the one used in _most_ cases, is the one from linux/types.h, > and that is using 'long'. The others, all typically on ILP32 platforms, > obviously must use long long. > > I have no objection to changing the types.h one to long long or all of > them to s64. It really shouldn't matter at all. I think that using s64 consistently (with any necessary alignment annotation) makes the most sense. That's unambigious, and what the common headers now use. Now that the scripted atomics are merged, I'd like to move arches over to arch_atomic_*(), so the argument and return types will become s64 everywhere. Thanks, Mark.