Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp810068imm; Wed, 4 Jul 2018 06:25:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf/2LEtte8N+yWHy2J2EJMLZgOmMAq44ioA2pWZm6VnO+0FJwzeKcyJE+7lw/HExcCXvhGu X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr2187972pls.32.1530710730526; Wed, 04 Jul 2018 06:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530710730; cv=none; d=google.com; s=arc-20160816; b=d0XMOXjhNBC9iV2seiqkI4z0STQRuDmxyNB54I6RQ4EEL5Qx9VWM3Ny3sjP1hYZdgZ 3Km64wNDskyEG2LEJSqZ7MIYoXdHiL2QY6E2jUkirZlaYGbo5xbfDaquRDFrUG4WXfnd ByPgR1AFB3FkqH0i9uX7TrXdlFluCsZLTjbIgxNuOah83L5Rxj5sPmll6nbROrkGi97m uXJNxHaPs7ad1vy/VK0siCW5Z2TwjukqUqa675GfoVLDyiOdDDD4GsVbBFbKlLrDfoiQ f41YODOTGiQ7honqAqeSxFp0mIyxYlJV/AR5QOhW2UxsBhI44Jhvm0PSx6Nuk3OXmi5G 8q/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=KKGe8sZZjxENwkVnol15KfFgBXAD5Z/x67E8n10fWdE=; b=Aa0A/iFv/P1dHgaHVBB7KX9gwz2eTRdK1/T5A722SDmEZYtZtf3ck8VYZ9je2UvdNg 2Gk3K+rhskB5aIBBOFPq3cm2wn/N63OUeaC4ILAXgcaeG55VzohfmD/vYU9i+oZFTg/o dijSXhxKj3hWGvnKP545+SdChbfkuBjkL44M+WTBK5YAlm2syf0yB/fVnXV8WFGZ9eZ8 mckBnOTxnKPCFt2Rk8GccHJCiUeO9qphlo16Rk3KD8dI3VOAQcjFTG9AWS+7+kiCJCQ+ T3T0PpX638eF8mA9tOLj8UqVsD/lXVMKSCW4sfUFBeUsRzoW+tOgVVQs0xCsaoCPfnwf pwMg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f32-v6si3571751plf.38.2018.07.04.06.25.15; Wed, 04 Jul 2018 06:25:30 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753331AbeGDNYU (ORCPT + 99 others); Wed, 4 Jul 2018 09:24:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35876 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753155AbeGDNYT (ORCPT ); Wed, 4 Jul 2018 09:24:19 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w64DNXMF136298 for ; Wed, 4 Jul 2018 09:24:18 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k0uterkgy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Jul 2018 09:24:18 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Jul 2018 14:24:15 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 4 Jul 2018 14:24:14 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w64DODAW25428208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 4 Jul 2018 13:24:13 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 626B6A4059; Wed, 4 Jul 2018 16:24:38 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E12E3A404D; Wed, 4 Jul 2018 16:24:37 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.160]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 4 Jul 2018 16:24:37 +0100 (BST) Date: Wed, 4 Jul 2018 16:24:11 +0300 From: Mike Rapoport To: Michal Hocko Cc: Andrew Morton , linux-mm , lkml , Matthew Wilcox Subject: Re: [PATCH] mm/memblock: replace u64 with phys_addr_t where appropriate References: <1530637506-1256-1-git-send-email-rppt@linux.vnet.ibm.com> <20180704130500.GP22503@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180704130500.GP22503@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18070413-0028-0000-0000-000002D82357 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070413-0029-0000-0000-0000238FAAFF Message-Id: <20180704132410.GH4352@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-04_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807040154 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 04, 2018 at 03:05:00PM +0200, Michal Hocko wrote: > On Tue 03-07-18 20:05:06, Mike Rapoport wrote: > > Most functions in memblock already use phys_addr_t to represent a physical > > address with __memblock_free_late() being an exception. > > > > This patch replaces u64 with phys_addr_t in __memblock_free_late() and > > switches several format strings from %llx to %pa to avoid casting from > > phys_addr_t to u64. > > > > CC: Michal Hocko > > CC: Matthew Wilcox > > Signed-off-by: Mike Rapoport > > --- > > mm/memblock.c | 46 +++++++++++++++++++++++----------------------- > > 1 file changed, 23 insertions(+), 23 deletions(-) > > > > diff --git a/mm/memblock.c b/mm/memblock.c > > index 03d48d8..20ad8e9 100644 > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -330,7 +330,7 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, > > { > > struct memblock_region *new_array, *old_array; > > phys_addr_t old_alloc_size, new_alloc_size; > > - phys_addr_t old_size, new_size, addr; > > + phys_addr_t old_size, new_size, addr, new_end; > > int use_slab = slab_is_available(); > > int *in_slab; > > > > @@ -391,9 +391,9 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, > > return -1; > > } > > > > - memblock_dbg("memblock: %s is doubled to %ld at [%#010llx-%#010llx]", > > - type->name, type->max * 2, (u64)addr, > > - (u64)addr + new_size - 1); > > + new_end = addr + new_size - 1; > > + memblock_dbg("memblock: %s is doubled to %ld at [%pa-%pa]", > > + type->name, type->max * 2, &addr, &new_end); > > I didn't get to check this carefully but this surely looks suspicious. I > am pretty sure you wanted to print the value here rather than address of > the local variable, right? It's the semantics of %pa: Physical address types phys_addr_t ---------------------------------- :: %pa[p] 0x01234567 or 0x0123456789abcdef For printing a phys_addr_t type (and its derivatives, such as resource_size_t) which can vary based on build options, regardless of the width of the CPU data path. Passed by reference. > -- > Michal Hocko > SUSE Labs > -- Sincerely yours, Mike.