From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019AbcIMNIt (ORCPT ); Tue, 13 Sep 2016 09:08:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46639 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750747AbcIMNIr (ORCPT ); Tue, 13 Sep 2016 09:08:47 -0400 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: rui.teng@linux.vnet.ibm.com Subject: Re: [RFC] mm: Change the data type of huge page size from unsigned long to u64 To: "Kirill A. Shutemov" References: <1473758765-13673-1-git-send-email-rui.teng@linux.vnet.ibm.com> <20160913093257.GA31186@node> <09ab7941-07fa-0003-46d8-9fa5c07eba2d@linux.vnet.ibm.com> <20160913114001.GB31186@node> Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Michal Hocko , Naoya Horiguchi , Chen Gang , "Kirill A . Shutemov" , Vlastimil Babka , "Aneesh Kumar K . V" , hejianet@linux.vnet.ibm.com From: Rui Teng Date: Tue, 13 Sep 2016 21:08:33 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20160913114001.GB31186@node> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16091313-0020-0000-0000-000009C4C5EE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005754; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000185; SDB=6.00757239; UDB=6.00359044; IPR=6.00530605; BA=6.00004715; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012661; XFM=3.00000011; UTC=2016-09-13 13:08:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16091313-0021-0000-0000-0000556F4172 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-13_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609130193 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/16 7:40 PM, Kirill A. Shutemov wrote: > On Tue, Sep 13, 2016 at 07:21:07PM +0800, Rui Teng wrote: >> On 9/13/16 5:32 PM, Kirill A. Shutemov wrote: >>> On Tue, Sep 13, 2016 at 05:26:05PM +0800, Rui Teng wrote: >>>> The huge page size could be 16G(0x400000000) on ppc64 architecture, and it will >>>> cause an overflow on unsigned long data type(0xFFFFFFFF). >>> >>> Huh? ppc64 is 64-bit system and sizeof(void *) is equal to >>> sizeof(unsigned long) on Linux (LP64 model). >>> >>> So where your 0xFFFFFFFF comes from? >>> >> The size of unsigned long data type is 4 bytes > > No, it's not. > Sorry, my fault! I print the unsigned long with "%ul" instead of "%lu" and got the wrong result. Sorry!