Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4126319rwb; Sat, 3 Dec 2022 18:24:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yc2oo8O7/quiqCSu+a1CpH4w0BmiK6aDDYCiumKyBIYYwhARRQSrbWQOlEDV6R/HmuxvI X-Received: by 2002:a05:6a00:a96:b0:554:4162:1ec1 with SMTP id b22-20020a056a000a9600b0055441621ec1mr59782560pfl.64.1670120659575; Sat, 03 Dec 2022 18:24:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670120659; cv=none; d=google.com; s=arc-20160816; b=Uu00FSG1Diis62fiwHq5vLvWftYTj2y87EsdWAdFg2PQOyzVvh+26EoPqhT02FBirO Y7Yva+hsmMy1dkcOhtwEaZTnRR6TM9BslfWR82M7wWL3EcthlYnWwti8NosRvtHsXNfL CFGGFxigrVNX8K3JSAhrFE8MveaE22NtkvHKY77b204p+T1TQinbQ5j0Pgy14m8pDJWk sCTDFRI105SGF0cCyxvH1yzWZBBDbgX1jcAsyAAuaP5DAGOYL4TUv+vBbPEuIJuff+U5 rTp+8hHzpcviKpiTGPJUhnWSJkmLrAWkVFlBptghlCxTjACGvRsj4IGF19y1fBwzXCSq Iatw== 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=p5OPg+DQ4r4Z/JFMiJuaclM/YLWn2Go/JtLJ0xxYwus=; b=v/N+pXjZh2JO80kba5JoVK9CIHiBG4kjZqor0KSfxeLU/JzGBRWWNgDW+cV5V6hEfV ECooSnHt+3+nKnp8L+rFFZ9jorNWu2bO0ig/9szuKxM8g33jbm4eD4+B/6UeH8ObWb2o wVslQ5VJY7ctRJ9Loi8wS/NVPOt9BnaR1a7KnO5Gfa3l073NUI5L7Xf7g0SvXtQY+fDZ UL12jzx6Hh2E/ZRD6DEXePKED0kngQFrgv+gHuJUBRhl/tE2/tt2U3unEaD9JSuDA594 E4diCuYhSVd63kjzfbsZ++wbPHYHAHpd6eAvBAfXgrLIQuF8yzkXmzdIr4T4C1mGEQG7 LQWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=enByNln7; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 7-20020a056a00070700b00574dbc0a46csi10540667pfl.274.2022.12.03.18.24.05; Sat, 03 Dec 2022 18:24:19 -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=enByNln7; 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 S229817AbiLDBc3 (ORCPT + 84 others); Sat, 3 Dec 2022 20:32:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbiLDBcT (ORCPT ); Sat, 3 Dec 2022 20:32:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E795D1A076 for ; Sat, 3 Dec 2022 17:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670117484; 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=p5OPg+DQ4r4Z/JFMiJuaclM/YLWn2Go/JtLJ0xxYwus=; b=enByNln7ytaE3T+QThfvPczLgEt7+4H6qCqvmfRfZbPzi4FoDhQwqXzUSyDsMWUG+ZLfji jidxf4fbMbDKng15ry2+H+8L5LmtMfrwLjiuXFFuvNBrnfY6Gqf6i5Gq2hbZ0QYnPuh42y yvjA4Abx6jXM9xUR8tkrj9b5Jnk0tJ4= 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-306-uIXwTZ5OO42nv2qg208mSw-1; Sat, 03 Dec 2022 20:31:20 -0500 X-MC-Unique: uIXwTZ5OO42nv2qg208mSw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 446C429ABA17; Sun, 4 Dec 2022 01:31:20 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-31.pek2.redhat.com [10.72.12.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E3D4141511E; Sun, 4 Dec 2022 01:31:15 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, stephen.s.brennan@oracle.com, urezki@gmail.com, willy@infradead.org, akpm@linux-foundation.org, hch@infradead.org, Baoquan He Subject: [PATCH v1 4/7] mm/vmalloc: explicitly identify vm_map_ram area when shown in /proc/vmcoreinfo Date: Sun, 4 Dec 2022 09:30:43 +0800 Message-Id: <20221204013046.154960-5-bhe@redhat.com> In-Reply-To: <20221204013046.154960-1-bhe@redhat.com> References: <20221204013046.154960-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.7 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: X-Mailing-List: linux-kernel@vger.kernel.org Now, by marking VMAP_RAM in vmap_area->flags for vm_map_ram area, we can clearly differentiate it with other vmalloc areas. So in s_show(), change the ambiguous checking 'if (!va->vm) to clear "if (!va->vm && (va->flags & VMAP_RAM))". This let's picks out vm_map_ram area, and avoids the being unmapped normal vmalloc area to be mistakenly recognized as vm_map_ram area. 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 --- mm/vmalloc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e6b46da3e044..3c60026fb162 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4181,11 +4181,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); -- 2.34.1