From patchwork Fri Jan 13 03:19:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13099677 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 0A4F6C54EBE for ; Fri, 13 Jan 2023 03:20:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96570900004; Thu, 12 Jan 2023 22:20:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 91576900003; Thu, 12 Jan 2023 22:20:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DDB3900004; Thu, 12 Jan 2023 22:20:03 -0500 (EST) 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 719DB900003 for ; Thu, 12 Jan 2023 22:20:03 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4492D1A03F8 for ; Fri, 13 Jan 2023 03:20:03 +0000 (UTC) X-FDA: 80348321886.04.B0A11B1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf13.hostedemail.com (Postfix) with ESMTP id 9C90620006 for ; Fri, 13 Jan 2023 03:20:01 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EwVgLOFc; spf=pass (imf13.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=1673580001; 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=Up8qi8mg3f3bZdJKv/Nh+iddy7WejAjVd5WVI12Zbwk=; b=4G+5Cq5blvv2DgDLebQuDnAKlKxnIePztyPIBEy8PXTZNyx6IgYOsJ/xkqHJ+ay6aBr9TX QBAhZVPu5fhxgpIry/xWaWrW6aMrN+Gvl3RxNXNqs1H5eyL+8MF8NeKQSLwaGtHSYXuf0v Pcxf7LXhy708c88bnPPEPcBmkGF+kg4= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EwVgLOFc; spf=pass (imf13.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=1673580001; a=rsa-sha256; cv=none; b=oLVuLHcPWCDV8kruHcp9aXQzvEHg3fyxvtBGdiIpvo6683RIW3ahgAjKNZbPuKlm7I/bJx eqhu+oejsowH2o9VfNPMN446t+gOzrllTjMVjQRl7rUB2lBjIVmvP1VMarBTJTlmwp9GDX I9S2jsYkIlC6uNsizp6TLz1Jg7oTlGg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673580001; 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=Up8qi8mg3f3bZdJKv/Nh+iddy7WejAjVd5WVI12Zbwk=; b=EwVgLOFcp0wJWfinD9jEqSbSeaDRrCbSNufcSNCz1XFq6VYJfJxRJM4O7vkOrM0wLK6MHP Jg/hPv18iTDQuXYEZxCs/Us5R40h247in2t6VoHEgVkpn2fCXXFW3tp3dsvOIkoJRjkjea r/pgPF08UOeEQIzAl5gXKDHeHi7/ZQU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-inWm5Br4NZyUUv9IZui68Q-1; Thu, 12 Jan 2023 22:19:55 -0500 X-MC-Unique: inWm5Br4NZyUUv9IZui68Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 667518027FE; Fri, 13 Jan 2023 03:19:55 +0000 (UTC) Received: from fedora.redhat.com (ovpn-12-229.pek2.redhat.com [10.72.12.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id D15164078903; Fri, 13 Jan 2023 03:19:49 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, urezki@gmail.com, lstoakes@gmail.com, stephen.s.brennan@oracle.com, willy@infradead.org, akpm@linux-foundation.org, hch@infradead.org, Baoquan He Subject: [PATCH v3 4/7] mm/vmalloc: explicitly identify vm_map_ram area when shown in /proc/vmcoreinfo Date: Fri, 13 Jan 2023 11:19:18 +0800 Message-Id: <20230113031921.64716-5-bhe@redhat.com> In-Reply-To: <20230113031921.64716-1-bhe@redhat.com> References: <20230113031921.64716-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9C90620006 X-Stat-Signature: cc7phc1qj4kn6fffzmb8forb5s4t39za X-Rspam-User: X-HE-Tag: 1673580001-457196 X-HE-Meta: U2FsdGVkX1+Bo/Q2B337c3+hjH3DPXni0r89cIIUNx2OwqxoogetKDWDumlG0uwZV/lwobmMUHc+6KSaZ5nsRBhoWkLuJIehTueJbnl/BboEPf3Co3MK1w7dsaOCFI4XE3xKsmLHAfUgtiNQLl66MjWfY/tFUHoDLWzWFOlq6LJ41W0az6btnTmxocxO3j6W+TrmDEd+4uXYGMOwp1Z5dcQNcx5OOQTwqvUZeCTg7uVR68Wfx8VgWkf3Ee121rqAm45EVzHHc4eScRLN19OSaItZnSja0Y6YUHLwdqJCrQtzi1doRMSDTEOR1NAvXAj10ON/SyEu+4Itx7R7pXJmdW2UcFi8SzHlJLwXHwErPWLGFsJ3Xz1L7gEe05WjfBBOVV7Vnkep1UQgCcPvM0YFblRimdV0OQZY+v6czoQFYZhwuyedXzLOcfuPIEgiMe6sh0m1K1NXon562CazX+dXT1xAb2v4rQCIyn8+sxxS0RuaqLjbIaI++Eaa6x/Ch/XFfcyDGnnekDEpT+b54g9dLoqFj6nnXrpW3aQ8pGuDCJa98+KXLdMEM3UHHbAqfshgHO63gf5zKiLlLBsKceDgxS0iee+A9/3cn7dizN3imn+gw+b97IVA1gf5nyJR6Cqu3jUKI+liHYqlCiyddsOeG8S6Jke4kharnwy82HFikk4WS2Dqkw4IoikLBQbIVN7J6ucnlrWwa1gorfz2ilEia/8noIEhZFd44XBSugccgEKvC2Q0GGRKzsneGQw1/klbwnZlw5Yp0cI7P0m9yMEROKikwGyShyKAiVopJQ9ehDrmnji18Hvh6aPRpXP3rmDBr1mXNISYg1ZzEtHCglxW9cI9QlOOiWSUNR4lxDa4mXOaWumr4TzQNhlOfy7OBbsroFfGfIjHkPxXhpizvbwByiT0kts0ayezOARjNJDWiWdzjxP+alOvQU8EYGhQsSh468r9y1s/eXibnFQk78P hcg== 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, 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: Uladzislau Rezki (Sony) Reviewed-by: Lorenzo Stoakes --- mm/vmalloc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 13875bc41e27..4a10b3b692fa 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4225,11 +4225,7 @@ 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) { + if (!va->vm && (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);