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 23E46C433EF for ; Sun, 27 Feb 2022 05:06:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 551758D0019; Sun, 27 Feb 2022 00:06:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5005C8D0007; Sun, 27 Feb 2022 00:06:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EED58D0019; Sun, 27 Feb 2022 00:06:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 309D48D0007 for ; Sun, 27 Feb 2022 00:06:30 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E7F3720757 for ; Sun, 27 Feb 2022 05:06:29 +0000 (UTC) X-FDA: 79187374098.14.55EEB02 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf19.hostedemail.com (Postfix) with ESMTP id EBE571A0002 for ; Sun, 27 Feb 2022 05:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645938389; x=1677474389; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Ma45tRABv3DOm24yibSpjnBT7pc4eQkuslcTGBgE5vo=; b=PrkBwzou5AlvorOEhdx5vPNdp5oC+XMNuRQEm3dfvaQqAtHJyKg/Tybd t1/z6OiR7NYaaUg2Pbn8/mMC510Q4+ZUBD9LuNV0KnFEycYhNaTz33FMm DHuIXqwBCV9PrgqkBUSnsgS59jrCnrSRIxG34gjT0YwrtMYex8k4n1Zac 6XQk7mxkh5xXuq6LgR23G7Afqqh367oimpLTzn0lF0/lkYFq4+oMs4nWd H8cGc3HOCKu0+ifLb6mqAolvfUd6atHlao8owXobHEt3lNWaotnjjfIDY OsliMgE+VsKaDAp5qCXEGGc0NUshIFUj0pzy7KyQGQ8cvYx/o9f8U8LHf w==; X-IronPort-AV: E=McAfee;i="6200,9189,10270"; a="277349475" X-IronPort-AV: E=Sophos;i="5.90,140,1643702400"; d="scan'208";a="277349475" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2022 21:06:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,140,1643702400"; d="scan'208";a="777775434" Received: from lkp-server01.sh.intel.com (HELO 788b1cd46f0d) ([10.239.97.150]) by fmsmga006.fm.intel.com with ESMTP; 26 Feb 2022 21:06:21 -0800 Received: from kbuild by 788b1cd46f0d with local (Exim 4.92) (envelope-from ) id 1nOBlE-0006ED-Pg; Sun, 27 Feb 2022 05:06:20 +0000 Date: Sun, 27 Feb 2022 13:06:01 +0800 From: kernel test robot To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Vlastimil Babka Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, David Rientjes , Christoph Lameter , Joonsoo Kim , Pekka Enberg , Roman Gushchin , Andrew Morton , Linux Memory Management List , patches@lists.linux.dev, linux-kernel@vger.kernel.org, Oliver Glitta , Faiyaz Mohammed , Dmitry Vyukov , Eric Dumazet , Jarkko Sakkinen , Johannes Berg , Yury Norov , Arnd Bergmann , James Bottomley , Matteo Croce , Marco Elver , Andrey Konovalov , Imran Khan , Zqiang , Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: Re: [PATCH] lib/stackdepot: Use page allocator if both slab and memblock is unavailable Message-ID: <202202271324.VLaJlMYW-lkp@intel.com> References: 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) X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: EBE571A0002 X-Stat-Signature: 8ufdpnb46rmjwhihfgz71qgb9y5k1n6i Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=PrkBwzou; spf=none (imf19.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com X-HE-Tag: 1645938388-709692 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: Hi Hyeonggon, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.17-rc5 next-20220225] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Hyeonggon-Yoo/lib-stackdepot-Use-page-allocator-if-both-slab-and-memblock-is-unavailable/20220227-111029 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2293be58d6a18cab800e25e42081bacb75c05752 config: hexagon-randconfig-r005-20220227 (https://download.01.org/0day-ci/archive/20220227/202202271324.VLaJlMYW-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e) 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://github.com/0day-ci/linux/commit/fd37f88eccc357002cc03a6a5fac60fb42552bc7 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Hyeonggon-Yoo/lib-stackdepot-Use-page-allocator-if-both-slab-and-memblock-is-unavailable/20220227-111029 git checkout fd37f88eccc357002cc03a6a5fac60fb42552bc7 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> lib/stackdepot.c:187:11: warning: comparison of distinct pointer types ('typeof (size) *' (aka 'unsigned int *') and 'typeof ((1UL << 14) << (11 - 1)) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types] size = min(size, PAGE_SIZE << (MAX_ORDER - 1)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:45:19: note: expanded from macro 'min' #define min(x, y) __careful_cmp(x, y, <) ^~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp' __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~~~~~~~ include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp' (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:20:28: note: expanded from macro '__typecheck' (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ 1 warning generated. vim +187 lib/stackdepot.c 168 169 /* 170 * __ref because of memblock_alloc(), which will not be actually called after 171 * the __init code is gone, because at that point slab_is_available() is true 172 */ 173 __ref int stack_depot_init(void) 174 { 175 static DEFINE_MUTEX(stack_depot_init_mutex); 176 177 mutex_lock(&stack_depot_init_mutex); 178 if (!stack_depot_disable && !stack_table) { 179 size_t size = (stack_hash_size * sizeof(struct stack_record *)); 180 int i; 181 182 if (slab_is_available()) { 183 pr_info("Stack Depot allocating hash table with kvmalloc\n"); 184 stack_table = kvmalloc(size, GFP_KERNEL); 185 } else if (totalram_pages() > 0) { 186 /* Reduce size because vmalloc may be unavailable */ > 187 size = min(size, PAGE_SIZE << (MAX_ORDER - 1)); 188 stack_hash_size = size / sizeof(struct stack_record *); 189 190 pr_info("Stack Depot allocating hash table with __get_free_pages\n"); 191 stack_table = (struct stack_record **) 192 __get_free_pages(GFP_KERNEL, get_order(size)); 193 } else { 194 pr_info("Stack Depot allocating hash table with memblock_alloc\n"); 195 stack_table = memblock_alloc(size, SMP_CACHE_BYTES); 196 } 197 198 if (stack_table) { 199 pr_info("Stack Depot hash table size=%u\n", stack_hash_size); 200 for (i = 0; i < stack_hash_size; i++) 201 stack_table[i] = NULL; 202 } else { 203 pr_err("Stack Depot hash table allocation failed, disabling\n"); 204 stack_depot_disable = true; 205 mutex_unlock(&stack_depot_init_mutex); 206 return -ENOMEM; 207 } 208 } 209 mutex_unlock(&stack_depot_init_mutex); 210 return 0; 211 } 212 EXPORT_SYMBOL_GPL(stack_depot_init); 213 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org