From patchwork Fri Jun 30 06:22:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13297637 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 39FCEEB64DA for ; Fri, 30 Jun 2023 06:08:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFD3A8D0001; Fri, 30 Jun 2023 02:08:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DACF38D0006; Fri, 30 Jun 2023 02:08:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C75C68D0001; Fri, 30 Jun 2023 02:08:51 -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 A7C6B8D0006 for ; Fri, 30 Jun 2023 02:08:51 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 785A5160788 for ; Fri, 30 Jun 2023 06:08:51 +0000 (UTC) X-FDA: 80958385662.04.EAB94B9 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf19.hostedemail.com (Postfix) with ESMTP id F24E41A0005 for ; Fri, 30 Jun 2023 06:08:48 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@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=1688105329; 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: references; bh=wYmrK6uF+a3TyMgXAC8qAFh8HlTVQQe5e2MCCbos+Ps=; b=Td2UY1B/aA1bJHkjkCYu6cq1bqMTsOXSyPpo6QnW0a7jSrNWM6zoCJKwNt2QT2Aa1uOlTQ RWj9vVGVrvPo0+4gkbsxUb8MwgWDezhbtTQx2xpYr02MCyfXktpS5sVKUvut+zScrMSwuG 5KSC96ThQfiHR8MStFAgWwKXHrMW0oo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688105329; a=rsa-sha256; cv=none; b=vfsvrpZSmT3oGF9ZdzO9OR+bEE4RmropdgkccROD1PVhlB1jXHV2MXDMTqTJ7WDBVq1Jsg J0aIJE3ZBD3fzjF8aH5b6GfcNfN8bgVtQN/rz1Gzz4VstXb0ZaheTec+5ZhOwwTL4DiYcf Brkn8VCv81SUo3zgxo2ms6kL4kwusYA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QslDf5ZPszqVmj; Fri, 30 Jun 2023 14:05:54 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 30 Jun 2023 14:08:40 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , Greg Kroah-Hartman , Michael Ellerman , Nicholas Piggin , Christophe Leroy , , Kefeng Wang Subject: [PATCH v2 1/2] mm: remove arguments of show_mem() Date: Fri, 30 Jun 2023 14:22:52 +0800 Message-ID: <20230630062253.189440-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: F24E41A0005 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: yqw1bf3g11xb5gd4y9zszhph5qgbgjfi X-HE-Tag: 1688105328-165379 X-HE-Meta: U2FsdGVkX1+nbHL/mrcBk2pB5yVYCkFulj0gfAxytTVtT3jcM1cMN1KWKXxpZjLMImYsSQWEwZrNzm+yOT8n3u1mIzR0Z7LKhdhizmXNNu7C9Gl83vk3rwkfaTSVhp7+94b17mmIDA+KFNN0V3qKLS+zgZQpJhCrHtbeyh/q5ssG2PUk+j4KciIxmlGzyjhETZP3yvsKO7zdjem3Gws2Se+6cGrNG5/qoLMvJjT+ybxUGKWxOgRw6oP300WKZn/aEwBSpJpJ+zFVoWBpwDfePD3YB/+ty1LRJ/oWaJbHjvPdNRGIIGSgEnw5Zo/aZxjnobMvnd/ds5HKT8ydQvAnoMhKwvIA9Uacc7TXRztzPnEMtJ4fc07jnmaNnvCYvVqfNcjbuYcKpallzwPcWWVYOYSzPdugYlxqJQkBnxzqqg09xqiftivoXjuvP0FknfL6Ik9w+8ahiepshecNtwj4Al9Gi9pgHMySnUCxGY41OYvRwVoJLuf5ioaMi3IB02cWvpEEKIgZsebE7YX6I9RCx579OZ9gbl1UJ7AzZxOC3fkx9PPmMhTdPz/e0axdpi8a2vIkTIUkFrkNc6HwmJPa2fV5rx6PsHADiMB8G1KqbfvztFlHWJhml8aEtOgGQ2GQ5PW6GIwaHk7a6Tqz+7mqeX5kqhafzZJXnMbHuj8kvZhHdN3fnd9Lweov1Vdapd+B+8H/ObC9MPuewDZn1dLVZlbS22LHKXPpHT0pWn2LUyD4U1Uey+fnBLfvCfgjtKEsIfp/AD1biX8iDOX42Ok6qUZhona09Lo7VUCtvfqa7IMAfUXe1edao9yEBYyDAtKzpGVepH+d+2q/gs9FoRIvv2iQt7+JNcT79XRJBe4D5Q0U0XapVUmPeLFLnQVcpeXrD28aPQ/waXc1BFTmWeBKIDETeRFazoXheLW6GqyUkldPYKkTK0FyYB5yAl/2pfxTrX07E4zvtBfaOuYVxc/ LxxfDuR1 Dld+7TK0U+ACtAJSLfTjbvivr4j7V0iDmN0eX+EZt0o5YLX/727M7Ejln5eScSbn/xqY5Puy/dkZ1TM/DlT9BuXcSINPbyupn2quPacmzdFdDRnG1BkbcyfA8+51+Q+DzbSSS/pmulNTHhOKIqnRNJR1/mdJvaZc+zjdkvNq3H9YRSrFto7Avovw43+U9UYDrl1Ra 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: All callers of show_mem() pass 0 and NULL, so we can remove the two arguments by directly calling __show_mem(0, NULL, MAX_NR_ZONES - 1) in show_mem(). Signed-off-by: Kefeng Wang --- v2: update commit log arch/powerpc/xmon/xmon.c | 2 +- drivers/tty/sysrq.c | 2 +- drivers/tty/vt/keyboard.c | 2 +- include/linux/mm.h | 4 ++-- init/initramfs.c | 2 +- kernel/panic.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index fae747cc57d2..ee17270d35d0 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -1084,7 +1084,7 @@ cmds(struct pt_regs *excp) memzcan(); break; case 'i': - show_mem(0, NULL); + show_mem(); break; default: termch = cmd; diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index b6e70c5cfa17..e1df63a88aac 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -342,7 +342,7 @@ static const struct sysrq_key_op sysrq_ftrace_dump_op = { static void sysrq_handle_showmem(int key) { - show_mem(0, NULL); + show_mem(); } static const struct sysrq_key_op sysrq_showmem_op = { .handler = sysrq_handle_showmem, diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index be8313cdbac3..358f216c6cd6 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -606,7 +606,7 @@ static void fn_scroll_back(struct vc_data *vc) static void fn_show_mem(struct vc_data *vc) { - show_mem(0, NULL); + show_mem(); } static void fn_show_state(struct vc_data *vc) diff --git a/include/linux/mm.h b/include/linux/mm.h index eef34f6a0351..ddb140e14f3a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3047,9 +3047,9 @@ extern void mem_init(void); extern void __init mmap_init(void); extern void __show_mem(unsigned int flags, nodemask_t *nodemask, int max_zone_idx); -static inline void show_mem(unsigned int flags, nodemask_t *nodemask) +static inline void show_mem(void) { - __show_mem(flags, nodemask, MAX_NR_ZONES - 1); + __show_mem(0, NULL, MAX_NR_ZONES - 1); } extern long si_mem_available(void); extern void si_meminfo(struct sysinfo * val); diff --git a/init/initramfs.c b/init/initramfs.c index e7a01c2ccd1b..8d0fd946cdd2 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -61,7 +61,7 @@ static void __init error(char *x) } #define panic_show_mem(fmt, ...) \ - ({ show_mem(0, NULL); panic(fmt, ##__VA_ARGS__); }) + ({ show_mem(); panic(fmt, ##__VA_ARGS__); }) /* link hash */ diff --git a/kernel/panic.c b/kernel/panic.c index 10effe40a3fa..07239d4ad81e 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -216,7 +216,7 @@ static void panic_print_sys_info(bool console_flush) show_state(); if (panic_print & PANIC_PRINT_MEM_INFO) - show_mem(0, NULL); + show_mem(); if (panic_print & PANIC_PRINT_TIMER_INFO) sysrq_timer_list_show(); From patchwork Fri Jun 30 06:22:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13297638 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 39F92EB64D7 for ; Fri, 30 Jun 2023 06:08:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DD958D0005; Fri, 30 Jun 2023 02:08:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98DA58D0001; Fri, 30 Jun 2023 02:08:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87BFC8D0005; Fri, 30 Jun 2023 02:08:51 -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 7821F8D0001 for ; Fri, 30 Jun 2023 02:08:51 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3910580760 for ; Fri, 30 Jun 2023 06:08:51 +0000 (UTC) X-FDA: 80958385662.04.91739BD Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf06.hostedemail.com (Postfix) with ESMTP id 92D4718000D for ; Fri, 30 Jun 2023 06:08:47 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688105328; a=rsa-sha256; cv=none; b=e9F6Xo4hww2IhuTsN70aqCmhrpQaBMXL/dZseqCDCzmwQfy32YhiKew14X9CkiC+ShCs7Q P3wAAmLxZ+pmUiK3blNl6EVt3MZ9kEcvrHlCuEMvRv6A+uJu1C1IQvz1PoTki47faFRgAL ri2LHy8Alg1qkxwBPwBxxi63fcH7dC8= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688105328; 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=mqA1YtnhbiGzOwi/xjFM7PuO2CD0ry4ulxksylAXiV4=; b=TlUfthYW7qLthq+ByBhfKbbIZhyoWr/gB7POnY8dEcq2nYRLjpJckDbzf1PD/kBGonttub gtDyWS3VymE5v0qBd/UQnKQmepjvb2wvVKpiFn7FM/aqz4UgfRgYPvEa3DqoxPOtuqSF85 O7C6YUjasDw/lqxXqHSc63n1I1VJ2Rk= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QslDg1z02zqVB2; Fri, 30 Jun 2023 14:05:55 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 30 Jun 2023 14:08:41 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , Greg Kroah-Hartman , Michael Ellerman , Nicholas Piggin , Christophe Leroy , , Kefeng Wang Subject: [PATCH v2 2/2] mm: make show_free_areas() static Date: Fri, 30 Jun 2023 14:22:53 +0800 Message-ID: <20230630062253.189440-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230630062253.189440-1-wangkefeng.wang@huawei.com> References: <20230630062253.189440-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 92D4718000D X-Stat-Signature: 9sed6zaac5igd74xosdtzawjpsun5zop X-Rspam-User: X-HE-Tag: 1688105327-905257 X-HE-Meta: U2FsdGVkX1/r6cOvIQY8pVnnd8UJNAVia4s1Z1sLcoY0xShL1oFYkmQO/lJWDO6lHfYqNmoqRTnO2thmo6MpkfFB7vg/KxnOAHh8iQ1a/IK9svJpLhv1NcQPD4JbLTcmHVl8xHUCNbY5a30xxWLtflTpmvu7xnxdnji3qr1cQXYk99AupvhmvFpQyVg8vdbF3WzId0nY4CMViT1IPkusN/D+WWuipmlMNqH1TIFlqWL3XQE7aYifBuFF0A5MeyO/XtMcHrgXDELsM/LwLO+T4evrmbIZSbGV5fvaZngW35XE6s9j7ahDH5M1qk38Ng/mgSHxIJ1bf98JpARI5I5qMBxWAOW1pSEgqEOqhQQGCa0mTR20GJ01Ncf0RTJOq+BBqR+bhesYbTyNe8y+5mTT2jz7p524RWkTvEaoKWJQd2n5wfEzFiGkoa9/vmKbmlxtiwxuURb+q/pdZUM6Hs8rDf2ulivlhM/eRvIxDt7rrq4i3espUb11KBrNwYdRpID1nXdDNcFQ3Xugijvvz9F/ft/OULFZLxGppKxqBtvBDvC5LjYLDfbOAvcKTUJvThO+F/+OkM/z41QybbGb9iHTAHhcJIQdHFUN8ZPp5Q8AR2K6EQRPYCajFmPsOiVp80dvgz/OYRpSOM55UVwbsQ8gctHO3/8JuDtlpWJDO+rwvct3dNrgdYhxcbQN42bNt7IAH9Ur14jqoSAV4fBxwXjZQSOsc9/pPkhYAjPVFNM6Wq+cF2YMxqXLK8B/K4tQIlLsd/79S4hAQThSLXFZVTBxjbcxY6oTcMsGEAmhmagnH4ReZoZ2r7ph4PAwKn8zEk9AE6pD2Y8UIJpg9F9E6vVBn0NuScjZ6z3fDQ9ZBZkH+JmDljeAJGwIkYFJAgP1e3AqUjLxyj72uwS5Ir4ODMr5PBahQxZ2GiqQ+3BKiD623PoPkaP4w0/gAg64EtuYp1kuXf1wDdgsYHYPhJNIugV NEUEb+qC Bdh1PJLPe//+lmjeW+unxbxqDYc2JAKVKqip161MBZNCBzTP/kzRusm620YRZq0P3y2l2sB3vjv1ZInWGFJm1/L+WHR5YL5/PQ7dg3rrK1fohf7vYPo2/ocb1rR6SwY0r/8DH5QyVXwXU/1FrqWyUrDzsSlfhti8RC3e15NNRutrXQF0V0wkPQ7WHDGKLoHcspaPv 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: All callers of show_free_areas() pass 0 and NULL, so we can directly use show_mem() instead of show_free_areas(0, NULL), which could make show_free_areas() a static function. Signed-off-by: Kefeng Wang --- v2: update commit log and fix a missing show_free_areas() conversion arch/sparc/kernel/setup_32.c | 2 +- include/linux/mm.h | 12 ------------ mm/internal.h | 6 ++++++ mm/nommu.c | 8 ++++---- mm/show_mem.c | 4 ++-- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index 1adf5c1c16b8..34ef7febf0d5 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -83,7 +83,7 @@ static void prom_sync_me(void) "nop\n\t" : : "r" (&trapbase)); prom_printf("PROM SYNC COMMAND...\n"); - show_free_areas(0, NULL); + show_mem(); if (!is_idle_task(current)) { local_irq_enable(); ksys_sync(); diff --git a/include/linux/mm.h b/include/linux/mm.h index ddb140e14f3a..0a1314a3ffae 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2218,18 +2218,6 @@ extern void pagefault_out_of_memory(void); #define offset_in_thp(page, p) ((unsigned long)(p) & (thp_size(page) - 1)) #define offset_in_folio(folio, p) ((unsigned long)(p) & (folio_size(folio) - 1)) -/* - * Flags passed to show_mem() and show_free_areas() to suppress output in - * various contexts. - */ -#define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ - -extern void __show_free_areas(unsigned int flags, nodemask_t *nodemask, int max_zone_idx); -static void __maybe_unused show_free_areas(unsigned int flags, nodemask_t *nodemask) -{ - __show_free_areas(flags, nodemask, MAX_NR_ZONES - 1); -} - /* * Parameter block passed down to zap_pte_range in exceptional cases. */ diff --git a/mm/internal.h b/mm/internal.h index a7d9e980429a..721ed07d7fd6 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -61,6 +61,12 @@ void page_writeback_init(void); #define COMPOUND_MAPPED 0x800000 #define FOLIO_PAGES_MAPPED (COMPOUND_MAPPED - 1) +/* + * Flags passed to __show_mem() and show_free_areas() to suppress output in + * various contexts. + */ +#define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ + /* * How many individual pages have an elevated _mapcount. Excludes * the folio's entire_mapcount. diff --git a/mm/nommu.c b/mm/nommu.c index f670d9979a26..bff51d8ec66e 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -990,7 +990,7 @@ static int do_mmap_private(struct vm_area_struct *vma, enomem: pr_err("Allocation of length %lu from process %d (%s) failed\n", len, current->pid, current->comm); - show_free_areas(0, NULL); + show_mem(); return -ENOMEM; } @@ -1223,20 +1223,20 @@ unsigned long do_mmap(struct file *file, kmem_cache_free(vm_region_jar, region); pr_warn("Allocation of vma for %lu byte allocation from process %d failed\n", len, current->pid); - show_free_areas(0, NULL); + show_mem(); return -ENOMEM; error_getting_region: pr_warn("Allocation of vm region for %lu byte allocation from process %d failed\n", len, current->pid); - show_free_areas(0, NULL); + show_mem(); return -ENOMEM; error_vma_iter_prealloc: kmem_cache_free(vm_region_jar, region); vm_area_free(vma); pr_warn("Allocation of vma tree for process %d failed\n", current->pid); - show_free_areas(0, NULL); + show_mem(); return -ENOMEM; } diff --git a/mm/show_mem.c b/mm/show_mem.c index 01f8e9905817..09c7d036d49e 100644 --- a/mm/show_mem.c +++ b/mm/show_mem.c @@ -186,7 +186,7 @@ static bool node_has_managed_zones(pg_data_t *pgdat, int max_zone_idx) * SHOW_MEM_FILTER_NODES: suppress nodes that are not allowed by current's * cpuset. */ -void __show_free_areas(unsigned int filter, nodemask_t *nodemask, int max_zone_idx) +static void show_free_areas(unsigned int filter, nodemask_t *nodemask, int max_zone_idx) { unsigned long free_pcp = 0; int cpu, nid; @@ -406,7 +406,7 @@ void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx) struct zone *zone; printk("Mem-Info:\n"); - __show_free_areas(filter, nodemask, max_zone_idx); + show_free_areas(filter, nodemask, max_zone_idx); for_each_populated_zone(zone) {