From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3839CC6FD1D for ; Thu, 23 Mar 2023 12:27:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C919E6B0072; Thu, 23 Mar 2023 08:27:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C40466B0074; Thu, 23 Mar 2023 08:27:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B08FF6B0075; Thu, 23 Mar 2023 08:27:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A326D6B0072 for ; Thu, 23 Mar 2023 08:27:42 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 78A1B806D0 for ; Thu, 23 Mar 2023 12:27:42 +0000 (UTC) X-FDA: 80600089164.12.019C929 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf01.hostedemail.com (Postfix) with ESMTP id AD5854000B for ; Thu, 23 Mar 2023 12:27:40 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tRGEsQdC; spf=pass (imf01.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679574460; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ERUF3I+UaOs4ILfHVy4lMlZp4H4fk/EejXcGposs5PY=; b=xT9vJYjMWkz+0foH7hMQgj126ADSG5IqeNbveq7NDWGSNYZ6TTXQKIFIJYbWqlZ+Dyh7qP ygj0gslNLzsEqWK74zN6MhoudekjMOw0HNHLP+Ddp+hGaXsL1W5uvk8Q0VtmwzcH3XZQ2Z vaerL/nhrsPM/W35/hmj/YgG+ame4G0= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tRGEsQdC; spf=pass (imf01.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679574460; a=rsa-sha256; cv=none; b=jo5DEzsnkgRiYqi/dwVLwIqIqTCjjKfoTkeYZ/3YVLtRB4UORdjTyUZW5Niztavk21PrkH LGHmRu9FC7txGakh66pUMRaMRLUHq0tIJOk5MAYj/wgtLTidPrHmGC/0QGdR98FG3mWJQm eAf2AU84CWstR/EgEGlRg1Ls+zh/Vwo= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DB650B820F4; Thu, 23 Mar 2023 12:27:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1780EC433EF; Thu, 23 Mar 2023 12:27:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679574457; bh=ZaRsJOcYse2OyML/obRxp1IBqiWf5RGXkXanE6A7UjI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tRGEsQdCB4lpVrizvt1+9WY33paC2gS4EIla1e1J4F/CaHCOnftvWEZhvh6WbOXKT ghOtEOSS328Fmkh92/GII+PjvGFYDRhJYas70lBQWff/QJip26cu8qB2lyyiPoJDpI Hau3ra6TKIYYUM+iJNa28Ac1AcS5EF530dCT2HwqfbR46pQMcZSuQWpWrYjhgMHw/s +o/s6mFUMWdiZgM+RaGE1PEeT3TMT+3omSTP1ttIj1hMsl6KFlIKGnmb2E0mOY5DrZ sB1E8QDhrcbWqiyPWAmAThVMXr4+jnjTkH3x4mrRWfduCdYLAsa48vsNtvyNh9oOSh Z2bn0dBAYGzDQ== Date: Thu, 23 Mar 2023 14:27:20 +0200 From: Mike Rapoport To: kernel test robot Cc: oe-kbuild-all@lists.linux.dev, Andrew Morton , Linux Memory Management List Subject: Re: [akpm-mm:mm-unstable 269/293] mm/mm_init.c:1386:33: warning: right shift count is negative Message-ID: References: <202303231850.ZgGa5u2h-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202303231850.ZgGa5u2h-lkp@intel.com> X-Rspamd-Queue-Id: AD5854000B X-Stat-Signature: digtjy5osf8qpy1e6qmcq8p4gwanzh8h X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1679574460-950883 X-HE-Meta: U2FsdGVkX1/MHHOgME2Ktf4wzyVCPP8ovjtAJZ2xwgqnAaHDS6nWCyzVGw5c+LCVLyWpH2A221G3yjGV0SYNlatfe4V0LFBHNRVBMEOSq/AJHa0ga3SLgnzpTfnNXhTS+Jj3CDu7h8W80eJG3j7brPuP5LMUuxScuhRfOYRbPAQAW1Hfr8l6Jos0M4bUboEq5UGdVSXE+X0qDaKjXUjVBGWPnCx2Lwxl+Wy+9YgQlk908ZuSIqbItBkkGoJR88cJ5rg3Tn+EhOxXVTuEjrPwFlGRAU+ScEKYftaNod4gc1MFRPfWG3kV/MMrggYbjfjE7ZXsa4Js6fRG1J9nkm+6IHfY413c/JWfa6CG//WhxaT6glLyF5H06PlaE4Pu0VTZY1thQfh2UjKDLXes9LbzQSZUx+jrhGu0HO07kH7omDzi1ws5VG9Vs4MlZQ3NQROR4oij8Ab+bYAKpcBhWi6kpLwuZHwG58LtoVBF0rJHsDOxx6RQwm7uidAlnCfqcY1ebW/hWOQsTdiN9X86QbEeuTz26OxA+Q7fS1nsmppg76BkkyydwSy7yuZHB8OqB8xTBQVXtCjMvCK16/ieIPqUkmApwIwShFD1a0JOKLmJpEgjJ47EypA80t6H/keITimUR0J4N87Vz4aNgRyHf04p4ZrQwryX2X8FK+loQ5VJZI+hk7s6I/PrJusbmImu8Ao3CVmGUrpiKixjBhACdsUCk/nuAs+AN8IyzEbCfT5hGlTChjN6MkRNqAjqIkuW1LcM6Aoyd1vZNiVZI3puB0R99JjVQ9dkMQV6bX3PoDLVQ9W+zzcLMBxJHdv20oTD6j9cUJW3cEqOMyNxfXDeyVRhxxeAsCttz+qUEWwauML1CcupDe5gd7CQ8bhsZfh1cB+4PEUA30VRS68IdocVp1LdU4dNg1dCJLJ9cfQWjyJP7425k7Vo656ssOifEVPxhnuKDZ/jS/WIpLvEXbPcTv0 e1oO4O49 pSSPh9Ak8yOKHAKM/bLsPjNJeSTjpGlWgdBy4o+XJTwB2Z9BOP/f0DWhiA/aOv3InViJttbaQALrGQVKa0nPHOtxgOa41zhHT6muELXbNHo19co9oZLRfDKhPxUo05+j5zD3eOlQRPzHANgiRU14xbA/CYOdDJWVHche9Qxpjszs7pVD29WuPeTryzGxWWC7EjpsAZsgaNB69aluWZjH9HTrBKoNrFJqvWxQZ7eMQp5AKJ2phza5Ssv8NRQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 23, 2023 at 07:01:38PM +0800, kernel test robot wrote: > Hi Mike, > > FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable > head: 51551d71edbc998fd8c8afa7312db3d270f5998e > commit: a37d26b620530076879100bb6e3953458bf069fe [269/293] mm: move most of core MM initialization to mm/mm_init.c > config: loongarch-allnoconfig (https://download.01.org/0day-ci/archive/20230323/202303231850.ZgGa5u2h-lkp@intel.com/config) > compiler: loongarch64-linux-gcc (GCC) 12.1.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?id=a37d26b620530076879100bb6e3953458bf069fe > git remote add akpm-mm https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git > git fetch --no-tags akpm-mm mm-unstable > git checkout a37d26b620530076879100bb6e3953458bf069fe > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > | Link: https://lore.kernel.org/oe-kbuild-all/202303231850.ZgGa5u2h-lkp@intel.com/ > > All warnings (new ones prefixed by >>): These are old warnings, they just moved from mm/page_alloc.c to mm/mm_init.c > 58 | #define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages) > | ^~~~~~~~~~ > include/linux/pageblock-flags.h:58:59: note: in expansion of macro 'pageblock_nr_pages' > 58 | #define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages) > | ^~~~~~~~~~~~~~~~~~ > mm/mm_init.c:787:32: note: in expansion of macro 'pageblock_start_pfn' > 787 | if (!pfn_valid(pageblock_start_pfn(pfn))) { > | ^~~~~~~~~~~~~~~~~~~ > include/linux/pageblock-flags.h:55:38: warning: left shift count is negative [-Wshift-count-negative] > 55 | #define pageblock_nr_pages (1UL << pageblock_order) > | ^~ > include/uapi/linux/const.h:32:61: note: in definition of macro '__ALIGN_KERNEL_MASK' > 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) > | ^~~~ > include/linux/align.h:9:33: note: in expansion of macro '__ALIGN_KERNEL' > 9 | #define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a)) > | ^~~~~~~~~~~~~~ > include/linux/pageblock-flags.h:58:41: note: in expansion of macro 'ALIGN_DOWN' > 58 | #define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages) > | ^~~~~~~~~~ > include/linux/pageblock-flags.h:58:59: note: in expansion of macro 'pageblock_nr_pages' > 58 | #define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages) > | ^~~~~~~~~~~~~~~~~~ > mm/mm_init.c:787:32: note: in expansion of macro 'pageblock_start_pfn' > 787 | if (!pfn_valid(pageblock_start_pfn(pfn))) { > | ^~~~~~~~~~~~~~~~~~~ > include/linux/pageblock-flags.h:55:38: warning: left shift count is negative [-Wshift-count-negative] > 55 | #define pageblock_nr_pages (1UL << pageblock_order) > | ^~ > include/uapi/linux/const.h:32:50: note: in definition of macro '__ALIGN_KERNEL_MASK' > 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) > | ^~~~ > include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' > 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) > | ^~~~~~~~~~~~~~ > include/linux/pageblock-flags.h:59:41: note: in expansion of macro 'ALIGN' > 59 | #define pageblock_end_pfn(pfn) ALIGN((pfn) + 1, pageblock_nr_pages) > | ^~~~~ > include/linux/pageblock-flags.h:59:58: note: in expansion of macro 'pageblock_nr_pages' > 59 | #define pageblock_end_pfn(pfn) ALIGN((pfn) + 1, pageblock_nr_pages) > | ^~~~~~~~~~~~~~~~~~ > mm/mm_init.c:788:31: note: in expansion of macro 'pageblock_end_pfn' > 788 | pfn = pageblock_end_pfn(pfn) - 1; > | ^~~~~~~~~~~~~~~~~ > include/linux/pageblock-flags.h:55:38: warning: left shift count is negative [-Wshift-count-negative] > 55 | #define pageblock_nr_pages (1UL << pageblock_order) > | ^~ > include/uapi/linux/const.h:32:61: note: in definition of macro '__ALIGN_KERNEL_MASK' > 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) > | ^~~~ > include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' > 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) > | ^~~~~~~~~~~~~~ > include/linux/pageblock-flags.h:59:41: note: in expansion of macro 'ALIGN' > 59 | #define pageblock_end_pfn(pfn) ALIGN((pfn) + 1, pageblock_nr_pages) > | ^~~~~ > include/linux/pageblock-flags.h:59:58: note: in expansion of macro 'pageblock_nr_pages' > 59 | #define pageblock_end_pfn(pfn) ALIGN((pfn) + 1, pageblock_nr_pages) > | ^~~~~~~~~~~~~~~~~~ > mm/mm_init.c:788:31: note: in expansion of macro 'pageblock_end_pfn' > 788 | pfn = pageblock_end_pfn(pfn) - 1; > | ^~~~~~~~~~~~~~~~~ > mm/mm_init.c: In function 'memmap_init_range': > include/linux/pageblock-flags.h:55:38: warning: left shift count is negative [-Wshift-count-negative] > 55 | #define pageblock_nr_pages (1UL << pageblock_order) > | ^~ > include/linux/align.h:13:62: note: in definition of macro 'IS_ALIGNED' > 13 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) > | ^ > include/linux/pageblock-flags.h:57:51: note: in expansion of macro 'pageblock_nr_pages' > 57 | #define pageblock_aligned(pfn) IS_ALIGNED((pfn), pageblock_nr_pages) > | ^~~~~~~~~~~~~~~~~~ > mm/mm_init.c:863:21: note: in expansion of macro 'pageblock_aligned' > 863 | if (pageblock_aligned(pfn)) { > | ^~~~~~~~~~~~~~~~~ > In file included from include/linux/mmzone.h:19, > from include/linux/gfp.h:7, > from include/linux/xarray.h:15, > from include/linux/radix-tree.h:21, > from include/linux/idr.h:15, > from include/linux/kernfs.h:12, > from include/linux/sysfs.h:16, > from include/linux/kobject.h:20, > from mm/mm_init.c:11: > mm/mm_init.c: In function 'usemap_size': > include/linux/pageblock-flags.h:55:38: warning: left shift count is negative [-Wshift-count-negative] > 55 | #define pageblock_nr_pages (1UL << pageblock_order) > | ^~ > mm/mm_init.c:1384:39: note: in expansion of macro 'pageblock_nr_pages' > 1384 | zonesize += zone_start_pfn & (pageblock_nr_pages-1); > | ^~~~~~~~~~~~~~~~~~ > include/linux/pageblock-flags.h:55:38: warning: left shift count is negative [-Wshift-count-negative] > 55 | #define pageblock_nr_pages (1UL << pageblock_order) > | ^~ > include/linux/math.h:61:25: note: in definition of macro 'roundup' > 61 | typeof(y) __y = y; \ > | ^ > mm/mm_init.c:1385:40: note: in expansion of macro 'pageblock_nr_pages' > 1385 | usemapsize = roundup(zonesize, pageblock_nr_pages); > | ^~~~~~~~~~~~~~~~~~ > >> mm/mm_init.c:1386:33: warning: right shift count is negative [-Wshift-count-negative] > 1386 | usemapsize = usemapsize >> pageblock_order; > | ^~ > mm/mm_init.c: In function 'alloc_node_mem_map': > include/linux/mmzone.h:33:31: warning: left shift count is negative [-Wshift-count-negative] > 33 | #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER) > | ^~ > mm/mm_init.c:1587:43: note: in expansion of macro 'MAX_ORDER_NR_PAGES' > 1587 | start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); > | ^~~~~~~~~~~~~~~~~~ > include/linux/mmzone.h:33:31: warning: left shift count is negative [-Wshift-count-negative] > 33 | #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER) > | ^~ > include/uapi/linux/const.h:32:50: note: in definition of macro '__ALIGN_KERNEL_MASK' > 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) > | ^~~~ > include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' > 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) > | ^~~~~~~~~~~~~~ > mm/mm_init.c:1600:23: note: in expansion of macro 'ALIGN' > 1600 | end = ALIGN(end, MAX_ORDER_NR_PAGES); > | ^~~~~ > mm/mm_init.c:1600:34: note: in expansion of macro 'MAX_ORDER_NR_PAGES' > 1600 | end = ALIGN(end, MAX_ORDER_NR_PAGES); > | ^~~~~~~~~~~~~~~~~~ > include/linux/mmzone.h:33:31: warning: left shift count is negative [-Wshift-count-negative] > 33 | #define MAX_ORDER_NR_PAGES (1 << MAX_ORDER) > | ^~ > include/uapi/linux/const.h:32:61: note: in definition of macro '__ALIGN_KERNEL_MASK' > 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) > | ^~~~ > include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' > 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) > | ^~~~~~~~~~~~~~ > mm/mm_init.c:1600:23: note: in expansion of macro 'ALIGN' > 1600 | end = ALIGN(end, MAX_ORDER_NR_PAGES); > | ^~~~~ > mm/mm_init.c:1600:34: note: in expansion of macro 'MAX_ORDER_NR_PAGES' > 1600 | end = ALIGN(end, MAX_ORDER_NR_PAGES); > | ^~~~~~~~~~~~~~~~~~ > > > vim +1386 mm/mm_init.c > > 1371 > 1372 #ifndef CONFIG_SPARSEMEM > 1373 /* > 1374 * Calculate the size of the zone->blockflags rounded to an unsigned long > 1375 * Start by making sure zonesize is a multiple of pageblock_order by rounding > 1376 * up. Then use 1 NR_PAGEBLOCK_BITS worth of bits per pageblock, finally > 1377 * round what is now in bits to nearest long in bits, then return it in > 1378 * bytes. > 1379 */ > 1380 static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned long zonesize) > 1381 { > 1382 unsigned long usemapsize; > 1383 > 1384 zonesize += zone_start_pfn & (pageblock_nr_pages-1); > 1385 usemapsize = roundup(zonesize, pageblock_nr_pages); > > 1386 usemapsize = usemapsize >> pageblock_order; > 1387 usemapsize *= NR_PAGEBLOCK_BITS; > 1388 usemapsize = roundup(usemapsize, 8 * sizeof(unsigned long)); > 1389 > 1390 return usemapsize / 8; > 1391 } > 1392 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests -- Sincerely yours, Mike.