From patchwork Fri Nov 5 20:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605547 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49680C433EF for ; Fri, 5 Nov 2021 20:39:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 11A8B611C4 for ; Fri, 5 Nov 2021 20:39:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 11A8B611C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B140E940058; Fri, 5 Nov 2021 16:39:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC475940049; Fri, 5 Nov 2021 16:39:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98B1C940058; Fri, 5 Nov 2021 16:39:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8347D940049 for ; Fri, 5 Nov 2021 16:39:30 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4332E82499A8 for ; Fri, 5 Nov 2021 20:39:30 +0000 (UTC) X-FDA: 78776042100.09.67936B7 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf12.hostedemail.com (Postfix) with ESMTP id 7E4BF10000B0 for ; Fri, 5 Nov 2021 20:39:29 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 94C986056B; Fri, 5 Nov 2021 20:39:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636144768; bh=195WpJFUXCAzHcNg6yr8SaCAS75bTx0VLBndn3JQVuA=; h=Date:From:To:Subject:In-Reply-To:From; b=DoU5EyvSPtmibve1UJHVhmbEKohWk+ViF20gplNgqiwKcRTm28YrSIH4hKzl6Ng/N 798WwQD88VBANkrJccoGDZ11LkSLPFao6S/VnJMlozmsxzj+QTSrZfXci4b1mQ53G1 tbTRWgAdyG6SFYU7aPglxzXcvJFhwOBUbXJhSI/g= Date: Fri, 05 Nov 2021 13:39:28 -0700 From: Andrew Morton To: akpm@linux-foundation.org, edumazet@google.com, linux-mm@kvack.org, lpf.vector@gmail.com, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, urezki@gmail.com Subject: [patch 092/262] mm/vmalloc: make sure to dump unpurged areas in /proc/vmallocinfo Message-ID: <20211105203928.VUhnNzshg%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=DoU5EyvS; dmarc=none; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 7E4BF10000B0 X-Stat-Signature: cxg8wyeucidt7x4ijuuptp1tx1br9bna X-HE-Tag: 1636144769-438743 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: From: Eric Dumazet Subject: mm/vmalloc: make sure to dump unpurged areas in /proc/vmallocinfo If last va found in vmap_area_list does not have a vm pointer, vmallocinfo.s_show() returns 0, and show_purge_info() is not called as it should. Link: https://lkml.kernel.org/r/20211001170815.73321-1-eric.dumazet@gmail.com Fixes: dd3b8353bae7 ("mm/vmalloc: do not keep unpurged areas in the busy tree") Signed-off-by: Eric Dumazet Cc: Uladzislau Rezki (Sony) Cc: Pengfei Li Signed-off-by: Andrew Morton --- mm/vmalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/vmalloc.c~mm-vmalloc-make-sure-to-dump-unpurged-areas-in-proc-vmallocinfo +++ a/mm/vmalloc.c @@ -3913,7 +3913,7 @@ static int s_show(struct seq_file *m, vo (void *)va->va_start, (void *)va->va_end, va->va_end - va->va_start); - return 0; + goto final; } v = va->vm; @@ -3954,6 +3954,7 @@ static int s_show(struct seq_file *m, vo /* * As a final step, dump "unpurged" areas. */ +final: if (list_is_last(&va->list, &vmap_area_list)) show_purge_info(m);