[v4,4/7] mm/vmalloc: explicitly identify vm_map_ram area when shown in /proc/vmcoreinfo
Message ID | 20230201091339.61761-5-bhe@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp172311wrn; Wed, 1 Feb 2023 01:26:41 -0800 (PST) X-Google-Smtp-Source: AK7set+a+uX4N+pHrXmIkmCyLsS2ERq7ujSejjfB4LPbgYtPUDnC+QZJJ4MBelDP+/po0bA7pTXM X-Received: by 2002:a62:1ec2:0:b0:592:5d24:772b with SMTP id e185-20020a621ec2000000b005925d24772bmr13523106pfe.17.1675243600870; Wed, 01 Feb 2023 01:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675243600; cv=none; d=google.com; s=arc-20160816; b=X4vW5wkG+hQwUSfKcEhdOGunLitiRQHLs98i/4yKbAHpUezxdr5GbS5Ap/aB252m93 W7CkVe07PK1cKkKb8qnSreipDSojgfWORit1g1kV5H9MMe8Y7NlTulO+y9rbxYJvpKwD j0L/zGLGSAEkcqNi/gzDyax9bHWv4wpA7v1tW6YtdHGKT1+z5ZxahrDETxZqPIKQtjTM npYdAu87uTgUeIzLoSb6LI8c/QewkGirBVf/Rxv9AUCsT0y4/pJ9sla+fY5M7LFj+1hE xT/efzRKXYMqoih93babzjrp8jBVx+sWjC7o6AZuZUyPcMRD6bwiEDWoVax3bAcIefHs S0+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lwQwhIj1auad521gDBOFO4aLd61Z5eggdloWlWE1BFg=; b=IfeIHK5WxAByW0HuV+EHdOQdEoEisCLhH6XKQeA0gO5CoTpzborT9Ze8teV5vDuUG7 Gn9KfTmjEYpxkZpgc27BQemGP3ZHkkwRCF3ozej9ueNzJLjEhXxoK8nl28m7dbxK1LUY SIaXTHBVK81IKXfYWK+IWS6bhZ2WidaKh0dFBQ24hBNPQvH500IpB2shs65uDgy+nqxL 8Xg8OiLojwjx5rm66TWQyUAYrp7PxZsH29pVfhn8+JgriS2Ca3Iur0kMjjmCELkXewes lCYSSDsqwtveLOyStLFEMqQqRWrZBq0zj1MMRQdZY8SU2gNfsdTtYOPns/hbyUC+PvzD VG5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JKJCggTs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h129-20020a625387000000b00574b46d3b26si18540975pfb.334.2023.02.01.01.26.28; Wed, 01 Feb 2023 01:26:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JKJCggTs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231923AbjBAJPL (ORCPT <rfc822;duw91626@gmail.com> + 99 others); Wed, 1 Feb 2023 04:15:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231947AbjBAJOv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 1 Feb 2023 04:14:51 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 171D08A51 for <linux-kernel@vger.kernel.org>; Wed, 1 Feb 2023 01:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675242849; 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=JKJCggTsy5oy3S9JmD8yk5d4peLM6cv7uLgxaZNpAPF0GL/hEORpwXFRSu2uK4zUNk1ALD g3h3sZmS/FjsGta16UGPyUjjhtGzEQdjIpiG+dhray3h+f8WYOmbdJeJaq6zuiOs8gextR 6dGd9nKVjhqhaO0wbsHK4J1PgvBua4g= 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 <bhe@redhat.com> 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 <bhe@redhat.com> 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756620233542119656?= X-GMAIL-MSGID: =?utf-8?q?1756620233542119656?= |
Series |
mm/vmalloc.c: allow vread() to read out vm_map_ram areas
|
|
Commit Message
Baoquan He
Feb. 1, 2023, 9:13 a.m. UTC
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 <bhe@redhat.com>
---
mm/vmalloc.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
Comments
On Wed, Feb 01, 2023 at 05:13:36PM +0800, Baoquan He wrote: > 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 <bhe@redhat.com> > --- > 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; > } > -- > 2.34.1 > Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
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; }