From patchwork Wed Feb 1 09:13:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13123987 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 4961EC05027 for ; Wed, 1 Feb 2023 09:14:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA7276B0071; Wed, 1 Feb 2023 04:14:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D57F26B0072; Wed, 1 Feb 2023 04:14:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C20706B0078; Wed, 1 Feb 2023 04:14:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B4AAB6B0071 for ; Wed, 1 Feb 2023 04:14:15 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 98954120E1B for ; Wed, 1 Feb 2023 09:14:15 +0000 (UTC) X-FDA: 80418161670.15.732752F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf11.hostedemail.com (Postfix) with ESMTP id DECB740012 for ; Wed, 1 Feb 2023 09:14:13 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WIqsKWyQ; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675242853; 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:dkim-signature; bh=lwQwhIj1auad521gDBOFO4aLd61Z5eggdloWlWE1BFg=; b=rfrAgMcIZGSd1FS2Iehv7JMUUcIdjP+oKbQAaXvEX11d1LZiRkIIoIUbrrldlZ4vP6SQWD EOhBq+Qk8/YbNCSeBszkBtJSEFegaeY5ujO5zAcOC/84YT7vrvLI+4YfGOM5wgk0p2HZOi AcO8LqGuN3OyhvDBbIPxfExVtiu5u+Q= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WIqsKWyQ; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675242853; a=rsa-sha256; cv=none; b=bkN6dEa/S70e3v5AsK5I8tebQO8QoVb9hoEhVfjszyef8zdAIN9ToZrYrT1CsLqYjsa7SH IIAAEX56H5cfDK+y0rsV24roRR1Wbm9t4rtPQrJbU0K0l8ZecDYorVwQpvPgnIomC1XdzO Ml+zp/fPdcSnLgdzCKMOl4Xkkjg6+4A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675242853; h=from:from: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=lwQwhIj1auad521gDBOFO4aLd61Z5eggdloWlWE1BFg=; b=WIqsKWyQU5D8JADJSkHVWW3XOF1Kie8d2kTOwaPo/shWixXfX2kWVyeHJN/XwAFpx7xFMR /6H0zz3HNJ16MHFBBWxuN6jVg+RBz/lKLpSrK5fUMM0XbxNbXFmn62mXxWCP58CwiWg1Tv 01HtukhS6nY/uLebxtbjiYfkG2LYqKo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-275-jqZCJ4_SMc2RbMYr6ekGIg-1; Wed, 01 Feb 2023 04:14:08 -0500 X-MC-Unique: jqZCJ4_SMc2RbMYr6ekGIg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57E7B1C04B71; Wed, 1 Feb 2023 09:14:07 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-89.pek2.redhat.com [10.72.13.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9A6E492C3E; Wed, 1 Feb 2023 09:14:02 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, stephen.s.brennan@oracle.com, urezki@gmail.com, lstoakes@gmail.com, willy@infradead.org, hch@infradead.org, error27@gmail.com, Baoquan He Subject: [PATCH v4 4/7] mm/vmalloc: explicitly identify vm_map_ram area when shown in /proc/vmcoreinfo Date: Wed, 1 Feb 2023 17:13:36 +0800 Message-Id: <20230201091339.61761-5-bhe@redhat.com> In-Reply-To: <20230201091339.61761-1-bhe@redhat.com> References: <20230201091339.61761-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DECB740012 X-Stat-Signature: bgcfnx9f99bmqteoeweqgp47dxquaoug X-HE-Tag: 1675242853-673312 X-HE-Meta: U2FsdGVkX19AKFW7TvGGgn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xnHlHlwpeBG4zMXvyZqpXvEUo+OSGDKH6NeFCmxudLch/wrfTaaMRQujqqJLgY5Ed0agCJRHhSig6rTRCipa9R4G7zOUbQ1QL2OKmPNx5AmyDESIZJyqgle7YAU= 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: Now, by marking VMAP_RAM in vmap_area->flags for vm_map_ram area, we can clearly differentiate it with other vmalloc areas. So identify vm_map_area area by checking VMAP_RAM of vmap_area->flags when shown in /proc/vmcoreinfo. Meanwhile, the code comment above vm_map_ram area checking in s_show() is not needed any more, remove it here. Signed-off-by: Baoquan He Reviewed-by: Lorenzo Stoakes --- mm/vmalloc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 5a3ea6cb7ec2..e515dbacb0cb 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4232,14 +4232,11 @@ static int s_show(struct seq_file *m, void *p) va = list_entry(p, struct vmap_area, list); - /* - * s_show can encounter race with remove_vm_area, !vm on behalf - * of vmap area is being tear down or vm_map_ram allocation. - */ if (!va->vm) { - seq_printf(m, "0x%pK-0x%pK %7ld vm_map_ram\n", - (void *)va->va_start, (void *)va->va_end, - va->va_end - va->va_start); + if (va->flags & VMAP_RAM) + seq_printf(m, "0x%pK-0x%pK %7ld vm_map_ram\n", + (void *)va->va_start, (void *)va->va_end, + va->va_end - va->va_start); goto final; }