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 9C5FCC7EE23 for ; Mon, 29 May 2023 00:37:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED5D7900003; Sun, 28 May 2023 20:37:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E85CF900002; Sun, 28 May 2023 20:37:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D75D2900003; Sun, 28 May 2023 20:37:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C56B3900002 for ; Sun, 28 May 2023 20:37:31 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 969B416033C for ; Mon, 29 May 2023 00:37:31 +0000 (UTC) X-FDA: 80841429102.08.2053411 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf20.hostedemail.com (Postfix) with ESMTP id 945561C000F for ; Mon, 29 May 2023 00:37:28 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of thunder.leizhen@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=thunder.leizhen@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685320649; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AO/YjJJ1ylRPaEz59mPozwYtVMUH/QoC0kO/XJVP3gI=; b=I4r6vJAmLDkOIIsR+AwuUzUV40w0QUgeZ4FKkPnB9UESssU18UyIA3pTk5bxch9vB9oIf9 YYI0K14ThIv6YJK0svnCApGsjnILTrubwk0PBVYGcgHsc8nAZlZDDHcZ0urxscSxHYUZEF YPnF+45B8rR1bim+3YEjlMmOH+jlVo0= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of thunder.leizhen@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=thunder.leizhen@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685320649; a=rsa-sha256; cv=none; b=yRpNZRyJxzoGtuhmbZ+mPWVFF62/QSOJSoAUzE5TlXnznBb/jrdxCW5kqLDxs7PrkVVph/ 8vn0JQFP8rmcf7pFXxfyusmVsjxoG6+oPs9uD5cbkdnYcPNyx5xCzND9XMtU6HHucet23w wI+Y+TIJ8CR073zh3AwYAu2tgdbFE/k= Received: from dggpemm500006.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QTxM44DJyz18Lc8; Mon, 29 May 2023 08:32:48 +0800 (CST) Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 29 May 2023 08:37:23 +0800 Subject: Re: [PATCH 5/6] kexec: add helper __crash_shrink_memory() To: kernel test robot , Eric Biederman , Baoquan He , , CC: , , Michael Holzheu , Andrew Morton , Linux Memory Management List , Amerigo Wang References: <20230527123439.772-6-thunder.leizhen@huawei.com> <202305280717.Pw06aLkz-lkp@intel.com> From: "Leizhen (ThunderTown)" Message-ID: Date: Mon, 29 May 2023 08:37:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <202305280717.Pw06aLkz-lkp@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 945561C000F X-Rspam-User: X-Stat-Signature: fye65ykd9kkdqzhczbnae81iiqizs8kb X-Rspamd-Server: rspam01 X-HE-Tag: 1685320648-160384 X-HE-Meta: U2FsdGVkX1+SZ8x5UcKIlNerju7sf/cV6iiVs3CPHe8RJmqWU9Gfxa1oKgfGNxWw35eKtRefdmYjYIIUTSbQJpTNT0InN4MrGewNSwIxv/VXQ54EgrQ2gkgVs4gWC4wHQADzD8W6OIUPmzcoiDbzN+tKxzpSBMFE7AFCzBhe62JQMzc5sIC5n92+jtevMO6PoxdubdRhDz+/ojuWa8DRFJp1LL7ZovhOEDhQlZ8ON6qhhx950rLDjrw5IY5oDTuFlt1YJJ5y+vKzAo2m9GTeFFiJY77gMVJXO08eBSza19yean5sgROU+UOi6oLwBA48W7Q7YyGqipefiyQSgUbBrRSTxOmpZ+nK3ynbUoCbum868uZ+EZVNzXUVq2WP1jXQ/U6JCj5DOQoNVe3/CouhwMlgXqHseGqEAgPbGngd8wK2SvuxxJpiy3kiqzKxHwDnHKJ3OqXIeoMvEUj4e1oGg+QYQKC38Ro/i5BQBlLdDkwhvz+FB+yNSdbb5mgBJjD7g6SKHWeTN+IlWwRy/HIq2ZdNenpIoYi556FWmUtDQCmbmgb07Ap8aL4aeRc+qTOxL42pcvFdwgy7P2eCAsiWnA8ubw3/BICHur1DhF8Br/48AYduRhjKswnT36NDsfAOulOBdLj/GX91w0C4av+sk93V4QC9rxmsAAv+V2cyVaBAxn27Y6ba9eiAD8RHnJXfes1wXzBib7CUdj+REshg91wGnPVXNK7awyw8rvbGXIDIHgxmL7RVZ1rkNStquhX6MlIs1+eX2wboowm2uU6HcyvNeutvL88e/aKVrDKyz+bS44l4gZ96PcXpNduYBFYNMLltXmbFx2kOt3oktLKvrmdIhQv2NYm4EfTmP0DvAYipzDs52wC8g8sQkJ+/wwpqMmYpjGZjjL3i+/+X2CmG73l5FwuDYQwe/n06Ddjx6b9ONDPmabd5mlmASZX9+icnDCSJ5GUHAAi8y2Bi31m 0yEHXvaT p8Xfv/hyaGBOYezZI8cVyABLUIVsiRgI5gENzOQOSf0sYBZ45pFkfc5EC7sV38RBn19zt4jCw+BCIhm31Q80fKlp0tk/I9PhiG/wUh0bMINIEhgP+dUT+4h7UW2lZJ3Wws2mEgjacAZwmKFei78EeCZdVwEMic/4AxPvCIvi4CdZ6Z/afTJSUBRk+1LibqTCUabQVpSQXL+udmJYVBwQtTibuJbDrCH1EJ5zi0KGTLuIXtaJywAvs4BK9vs+BKAWnvJPpivBfCKP4qY1dr0x7ZrbHE3GplEH6Cd+s412lKrMqYFkPoDVbT94LqNeUGIGl+yVOOJFj+BmNtMRoo3HyLoBYTCHq6qS/+Qs3DXWGRS5mGQ7+yTQ+s/Wgxa/8cKmX5Ati+/8++QNptEWHifqXIO2fBQmwY1N8JI1vj1KnUS2wRYWOV4D542CvldvaBLzPg0HPs3gTdmncP2MGPx83NDxNDW3Vi/0neQ2oZSVm1oPRm+4= 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 2023/5/28 8:08, kernel test robot wrote: > Hi Zhen, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on akpm-mm/mm-everything] > [also build test WARNING on linus/master v6.4-rc3 next-20230525] > [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#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Zhen-Lei/kexec-fix-a-memory-leak-in-crash_shrink_memory/20230527-203821 > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > patch link: https://lore.kernel.org/r/20230527123439.772-6-thunder.leizhen%40huawei.com > patch subject: [PATCH 5/6] kexec: add helper __crash_shrink_memory() > config: riscv-randconfig-r042-20230526 (https://download.01.org/0day-ci/archive/20230528/202305280717.Pw06aLkz-lkp@intel.com/config) > compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 4faf3aaf28226a4e950c103a14f6fc1d1fdabb1b) > reproduce (this is a W=1 build): > mkdir -p ~/bin > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install riscv cross compiling tool for clang build > # apt-get install binutils-riscv64-linux-gnu > # https://github.com/intel-lab-lkp/linux/commit/dea97cef503d26e05d0e11818ae44176056ddf64 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Zhen-Lei/kexec-fix-a-memory-leak-in-crash_shrink_memory/20230527-203821 > git checkout dea97cef503d26e05d0e11818ae44176056ddf64 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202305280717.Pw06aLkz-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > >>> kernel/kexec_core.c:1108:5: warning: no previous prototype for function '__crash_shrink_memory' [-Wmissing-prototypes] > int __crash_shrink_memory(struct resource *old_res, unsigned long new_size) > ^ > kernel/kexec_core.c:1108:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > int __crash_shrink_memory(struct resource *old_res, unsigned long new_size) > ^ > static > 1 warning generated. Yes, thanks, a 'static' should be added. > > > vim +/__crash_shrink_memory +1108 kernel/kexec_core.c > > 1107 >> 1108 int __crash_shrink_memory(struct resource *old_res, unsigned long new_size) > 1109 { > 1110 struct resource *ram_res; > 1111 > 1112 ram_res = kzalloc(sizeof(*ram_res), GFP_KERNEL); > 1113 if (!ram_res) > 1114 return -ENOMEM; > 1115 > 1116 ram_res->start = old_res->start + new_size; > 1117 ram_res->end = old_res->end; > 1118 ram_res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM; > 1119 ram_res->name = "System RAM"; > 1120 > 1121 if (!new_size) { > 1122 release_resource(old_res); > 1123 old_res->start = 0; > 1124 old_res->end = 0; > 1125 } else { > 1126 crashk_res.end = ram_res->start - 1; > 1127 } > 1128 > 1129 crash_free_reserved_phys_range(ram_res->start, ram_res->end); > 1130 insert_resource(&iomem_resource, ram_res); > 1131 > 1132 return 0; > 1133 } > 1134 > -- Regards, Zhen Lei