From patchwork Sat Dec 17 01:54:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13075749 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 896E6C4332F for ; Sat, 17 Dec 2022 01:55:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B2D18E0007; Fri, 16 Dec 2022 20:55:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 262578E0001; Fri, 16 Dec 2022 20:55:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12B0E8E0007; Fri, 16 Dec 2022 20:55:14 -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 05A548E0001 for ; Fri, 16 Dec 2022 20:55:14 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C38481203EF for ; Sat, 17 Dec 2022 01:55:13 +0000 (UTC) X-FDA: 80250130506.20.95CE56A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 302DB20004 for ; Sat, 17 Dec 2022 01:55:12 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=a05TfbOE; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671242112; 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=uJATgAbP8LGsegtuj/VmrUG/8tlhpffFE1cUvqDdgpk=; b=zpKIASQM8ZZ9Aad8Jj2al6evWW6sX8WG1KzE8EoPePncHv35cAmEXPqKEwxtUsX5JO5hZZ 5FruGDwV7PaZ1OrMVIIFoStmGncbP2+mQUxq3mWg3BpxtBlxx67R6pG9Zn06F0Ccs/pZjx TYmZzl1TYXuJizATaaQbSiBuSQMNUao= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=a05TfbOE; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671242112; a=rsa-sha256; cv=none; b=RdJOJ/VAnSM20YIuyOCAVTCAjtcriapiHBeGWpUVYjCTWTYrKn/oJMGEI/EaeD5PO34qpH TzI8mFv0IwgJqMFfjqzDC6ajLOYFliObicwHSm0huYtjLBrY/U6IepbDaxlhch3wAuZqiV OSLAeGHP78h20xPrKRlF3XVg+o/k+vA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671242111; 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=uJATgAbP8LGsegtuj/VmrUG/8tlhpffFE1cUvqDdgpk=; b=a05TfbOE/R49sEaJlaTNaM+M+vr/+bVhJ97YrY7b6ypyQBn4PfeekdAYHzirP7LQQ6pa0x GskxYxzPdwnAaIJui+lt8EgUnOZeky69AwIEm8WDOzeLf9MP+tMj20pwKqqGb0MTsl3qBx Eeie7QlPQH/Sf0GOWrq+5GOuvCXO0ek= 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-561-qDVspNCuOqqB61dUmUcbRA-1; Fri, 16 Dec 2022 20:55:06 -0500 X-MC-Unique: qDVspNCuOqqB61dUmUcbRA-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 8C50B101A55E; Sat, 17 Dec 2022 01:55:05 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-34.pek2.redhat.com [10.72.12.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EE9549BB6A; Sat, 17 Dec 2022 01:54:57 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, urezki@gmail.com, stephen.s.brennan@oracle.com, willy@infradead.org, akpm@linux-foundation.org, hch@infradead.org, Baoquan He Subject: [PATCH v2 4/7] mm/vmalloc: explicitly identify vm_map_ram area when shown in /proc/vmcoreinfo Date: Sat, 17 Dec 2022 09:54:32 +0800 Message-Id: <20221217015435.73889-5-bhe@redhat.com> In-Reply-To: <20221217015435.73889-1-bhe@redhat.com> References: <20221217015435.73889-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Rspamd-Queue-Id: 302DB20004 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: frsfweznwg6rizxaqftqb9dkqd91feto X-HE-Tag: 1671242112-980708 X-HE-Meta: U2FsdGVkX1+OE/p4M2n559sfX2+OOV64QlA8KoE2ZAl06C6702GGH6s/H8Cyk775gOTxO4SpYX6AwoBvTz4aKI20y1vygnSZ3Tteeo4GpQ6nyrpGzRx4d9rHmxNT3rrBG9WhHzF3vnTSEfS4AxSJXzI+ksgSC8IUfYmh32MX16qMv+4VZ7BrlRstRHZFIFJ5Lpihe9xgtji04/f2Xb7EzDXHTtW/FlYaSCYYfh8GdXIpMRec8cbtUAuDBsnGtc2JlC9dxTNSHLDXxGp3H+lXCkLNRjxCbR1J8ui0q4QXBlFsz/nIWJ239Rl/xTx4gFMTKlLAVUg6aLLXo6TouPgW0vWLW0wezTukfrwaS4mnK2DbB0qtAKdEUSx8IaB5cP43bJXE6fRkX3Hf5fTBaxSqQLTU1u4woNLrXaGmYQ8WV86ZnbAStWKEKapbmt0WtHpc3SKIc+qtOGmeaAf2OaZ5UMN81XYsLLIzIwqatfoMWU1NL8GQEEAnKIDgOuMEEuORw7cZ6tVPzgPSpC6ewbGzmRAt+o2O1fd+oW4CIUeypPvOZ7D7+Chx0SdP116I1ybto+2/ELaNbY+s0b4QhnxxDgqwce0bBhW4O2nQ7hbbCvEEi4nwqKVzMxlXZCQhjg+f3yMBBH1YXli9gNraDcxiQ1BpuGX5xYYTSOhyo5SkgYjjjTjbR8cG8lk1DzJmvklrn+xMMVv3Iibi6keq0NkppntL/XSxwuUkcYi661x/CH0QJrIZ9pCWVxgIcpZ0gKV/aZx4M1QemWgJXjfIEZLHBX86IoLJ3a3SJT0PZkl/tZpTQl/54dwam1PH0hyGyvdL76gun9OgJMLjG2b0+l9kQs25usMnvXqNy2Cv4ZCk7SFo5HDpeQf3jWnh3pXeinYbFJEWX2Ta2W+FXmtUNhxEp9ZSLbjl1i9yfJMh0ZqXEku//Bi1pb/H7GCY+/3Fp5Ae+YXAPyRpREMqH4ZiZ8D HCw== 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 --- mm/vmalloc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 6612914459cf..3bfa872a4513 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4182,11 +4182,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);