Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2830368imc; Wed, 13 Mar 2019 02:21:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+kUy4MG2WmQhDtCBDqeHWQi92x9Jee1qLpQ9ODX5vrgwcUe8P5PCfWm2zcOre00niFIRg X-Received: by 2002:a17:902:a413:: with SMTP id p19mr45527035plq.337.1552468876631; Wed, 13 Mar 2019 02:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552468876; cv=none; d=google.com; s=arc-20160816; b=QbFZCCM4l0hFVWrA/mCOcmGJHQbygfqwwtFGdl/QRbtj032cEMGogSb+DAKbnZyT8y srvMA3zQP4fg8lJCNQPZZiIeLcV+sMBgr79+wRy4JPUuDurFu0FnBdBIbomswcRsg1Gt ziPqWwb/PfKRKeNs0xQcwDJiPK7DuAWoaQLvz9Mp5wwkOkAEc3L/HCngEMe6ZpV+WKCB 3q7cCvk/tCS/+JOe4LL5nB6ZaCPlFWtmxvwShPfeAWj4AFltxT93RrjjEnTkNgzfdK+C /fFuLBSOTCQu1Qcy+FDOFUPp5llT9mAfXC+Ap7j3FR6fB9u/DJxvftAzqKQm14BfMq7s JEIg== 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:dkim-signature; bh=KzxQSaJbsqgdV04fsK2ylmeyEWpxrxzz2n7IfMtSZqI=; b=gwh1m1iHKSA2BofkFgkECGBaE0BboJcxDGBjBtVNw09mvUGzrgpmPFo5DIhqpS6Gh+ wbPPujqZPggJs6NbyzbruVPC3mNXpbp4jS3+wEOG9lY1GIeM1LHTrlJp13qrTbCKzp45 22luLM2ms6AgGg0LEWdF/z2mjxcTGPQIqT9N0Q/yR7bZf32pHpbBReFw0e1m/DpqZN1y MAAwTEusADkIEp0pRmLsmIkId4KNpDs6j0MvD6cGbojooBCOp20FWmVuwB0B0tfsw2v/ PlV2OiF5w26XU56KK0888nLUVkKbBYwpHpfjlNBVQUnybvbiO1kyWRQJbRoE0LU6jB82 FPLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Bq7+4Znd; 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 l9si10825011plb.216.2019.03.13.02.21.00; Wed, 13 Mar 2019 02:21:16 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Bq7+4Znd; 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 S1727339AbfCMJTH (ORCPT + 99 others); Wed, 13 Mar 2019 05:19:07 -0400 Received: from merlin.infradead.org ([205.233.59.134]:44914 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726843AbfCMJTG (ORCPT ); Wed, 13 Mar 2019 05:19:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KzxQSaJbsqgdV04fsK2ylmeyEWpxrxzz2n7IfMtSZqI=; b=Bq7+4Zndp7tTjNamrCv1IFoTS sY2LOFDg0fpvuUMjw6ms0dt7lKbF3tt1fjChxjzHCVmXCEElHpFsnz5bTt2+FyQSLIxPNEYbe5cbR VBz8e5t1nIQkUiBz7ILKnAPB2bywmeBCdpRU4a5IWO7Fjti9gQcPVbFH/zGhglDag2ZoozU+TJa8P dBjyy+DYaa1tVGqAfSgvE6wIFgJE+3mwHI/sf7TY9eApm28xIB3yPbF3TyLmj+UUsxtZlhtcuo4vl T6UEQ6z4YJJvgyC9zQbENyHWLpN1NA1hZzksIxUyHNOcMa9GwAqu0aGBtFb9mmWHNnClTjOUcUn1M vM2173Qag==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h402D-0007do-9r; Wed, 13 Mar 2019 09:18:49 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1C2252028B0F8; Wed, 13 Mar 2019 10:18:45 +0100 (CET) Date: Wed, 13 Mar 2019 10:18:44 +0100 From: Peter Zijlstra To: Arnd Bergmann Cc: Qian Cai , Jason Gunthorpe , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Mark Rutland Subject: Re: [PATCH] mm/debug: add a cast to u64 for atomic64_read() Message-ID: <20190313091844.GA24390@hirez.programming.kicks-ass.net> References: <20190310183051.87303-1-cai@lca.pw> <20190311035815.kq7ftc6vphy6vwen@linux-r8p5> <20190311122100.GF22862@mellanox.com> <1552312822.7087.11.camel@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.