From patchwork Sat Jan 11 04:26:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13935779 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 6B9CAE7719A for ; Sat, 11 Jan 2025 04:26:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BD036B00A5; Fri, 10 Jan 2025 23:26:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36A006B00A7; Fri, 10 Jan 2025 23:26:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 195E36B00A8; Fri, 10 Jan 2025 23:26:39 -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 E22CC6B00A5 for ; Fri, 10 Jan 2025 23:26:38 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9CD21B0736 for ; Sat, 11 Jan 2025 04:26:38 +0000 (UTC) X-FDA: 82993884876.24.B366FE5 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) by imf19.hostedemail.com (Postfix) with ESMTP id CADE21A0005 for ; Sat, 11 Jan 2025 04:26:36 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=uSRcEtuW; spf=pass (imf19.hostedemail.com: domain of 3-_KBZwYKCCwacZMVJOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--surenb.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3-_KBZwYKCCwacZMVJOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736569596; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hRZ4wMzIwoFaVH+QKckb3zqa5H5+gDzhM3t6myutkJ4=; b=n64xoy2DhQDx3Y9xw7pFNE9ZPRlVcI3kwXTpRpU2pOQo8Ow5gPXe47goK0UNKBNZgVDu3V yFK+oevsy3EYJ9hUlO4TGhkXBQf1g6COr/U1g31wuPpDKAaMecjv0fpAEbJ4gKLXNF13H+ 7b4GJqor+27YqaNHQRZgC9R0c6QWNGk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=uSRcEtuW; spf=pass (imf19.hostedemail.com: domain of 3-_KBZwYKCCwacZMVJOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--surenb.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3-_KBZwYKCCwacZMVJOWWOTM.KWUTQVcf-UUSdIKS.WZO@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736569596; a=rsa-sha256; cv=none; b=dU8k/njFg3Ci+SR7Qu82EZXxU86PoWkhnypZORr+m98Spscw0JVkQFJPGyzH0hqROJYmDM SkpGMPC1O2I6hXf7WNEZklSRWgFCQv6Hs7xT3654Hal+Mx6B/d3lBr2lnin4a5q44Bq8zD KEqY7gg4oJMIO0ydqBM50D2maLcXxUA= Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2ee46799961so6971965a91.2 for ; Fri, 10 Jan 2025 20:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736569595; x=1737174395; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=hRZ4wMzIwoFaVH+QKckb3zqa5H5+gDzhM3t6myutkJ4=; b=uSRcEtuWzvth5Cdj1XTIRi1HYyr/jzpDr5ERbv7J0F8288/emvBrbJ74FCDpYeTUdt lSmEulqX235V88LdDIKDa2MMl1MclaG/EtCw0E72p8cnKWqqiWU4lkEWGS6+USr5eK7M NkvqTe/8pbV//qi4Z0A9Eu2V81CPqR2qFtNCsS/GIZHhigLcJwnyhbHllZqgsJW1apYU nXYAxupaIGPn3LcKEhQ8YS4HNeZhOohXTfuakLjCNxL2GaHO1KlTYue93xopQ5c1La/H 9LvGOYwlLGVXee1Zf7xal5vudpEjLh+0HkL33KkMd0CiIyJYTqFxzBBDftELbHwJnsf5 WERw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736569595; x=1737174395; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hRZ4wMzIwoFaVH+QKckb3zqa5H5+gDzhM3t6myutkJ4=; b=kH63LMy4woq3VpY3BVTNEYO2/WAQYfMgQF7nAz8T9JrZXjn1Y6eFT+NgpSqZUnF50D tQMJpNznMwi3OFra/jBAos5Ozs8sXtMElgYONez1lTbcjaBJvXlvr8mo+M5N4BLXVxSJ KUqwa1D5+5rhaQWjyKQkcb9Advunj49I6/g7lJSy7cHCnW3Zt4xYbntZe4M1z4ierbhJ sLeuz9xDzcZdAFwviw86Yv9aoyu2RhP5xsK38d3ETeq3RyQssMGRu9MYxIqbq+mbMf1Y OGJrK6U7kt5iJiqAt7XnYKRVCUvv0zExmhzKC/hYAOfEVwMdEK1kEEFf70FYEqYr5Bdw 8vJw== X-Forwarded-Encrypted: i=1; AJvYcCU1Cu5EAE6KvbfbmuiepwbY1eWCy2VCuiTl7E/P8tupc1Fmg3JaR8Nw7sjen2MW4aooMQGFkTpuSw==@kvack.org X-Gm-Message-State: AOJu0Yywy+p7t947CUf+DDQ9c0UPbo/Ro2m1Mfo/UrobU6TpXeWWc0k/ DR1j3Ql31nQMnH0iAJ6w8wTREBAxltvrhnuRudf7Bi8jfXU1w4J1i94IJzugVV2QBnqF+9Rs1Ct FZg== X-Google-Smtp-Source: AGHT+IFTyAfsIAx+W8ijjylMHsN3oJ/EjAkXBdrJzAHIWy/euYIgMSi4UM4+efBYB633hSURtx6BkjgnB9k= X-Received: from pjbtb14.prod.google.com ([2002:a17:90b:53ce:b0:2ef:7352:9e97]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:548f:b0:2ee:7870:8835 with SMTP id 98e67ed59e1d1-2f548f80206mr20438054a91.33.1736569595602; Fri, 10 Jan 2025 20:26:35 -0800 (PST) Date: Fri, 10 Jan 2025 20:26:00 -0800 In-Reply-To: <20250111042604.3230628-1-surenb@google.com> Mime-Version: 1.0 References: <20250111042604.3230628-1-surenb@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20250111042604.3230628-14-surenb@google.com> Subject: [PATCH v9 13/17] mm/debug: print vm_refcnt state when dumping the vma From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: peterz@infradead.org, willy@infradead.org, liam.howlett@oracle.com, lorenzo.stoakes@oracle.com, david.laight.linux@gmail.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mjguzik@gmail.com, oliver.sang@intel.com, mgorman@techsingularity.net, david@redhat.com, peterx@redhat.com, oleg@redhat.com, dave@stgolabs.net, paulmck@kernel.org, brauner@kernel.org, dhowells@redhat.com, hdanton@sina.com, hughd@google.com, lokeshgidra@google.com, minchan@google.com, jannh@google.com, shakeel.butt@linux.dev, souravpanda@google.com, pasha.tatashin@soleen.com, klarasmodin@gmail.com, richard.weiyang@gmail.com, corbet@lwn.net, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: CADE21A0005 X-Rspam-User: X-Stat-Signature: 4efbrq3794nf41ashnpnkzym78aw3a5e X-HE-Tag: 1736569596-149070 X-HE-Meta: U2FsdGVkX1+vnWI3B6s35gMzraQsXZOnSrnM40rajBzB/0cZgpprtbNrUzZOkIPyGZIMdso7iytvxDfad+i9N9f9alSgbyVdQaNSR952jko+z5YIjypTG2+NBNx+q4338YTEsawsq38CnqEyrHM+Y2ixTbFI1YvyM+ZrWB45baGRfTZMv7eP0r2dI3JW8PLKyPg5JgzaKOpK/HVAZ06T5iXTkE/SET4LaKGmRHOutGvLZfhy3ZZIvDZpceNgewIzLxhmT7a+8uIcD8/J6w+nH22rLWbDNpcNTJYL84IroEck1fXJvdioHB3CBKhTIVIGB+VIq2RCXw6yRZbu0A4xXvi7hjC4JegMHoWh6TOgHHYAfBNpUINi5Gc+5SCib4vgh1yPP7aX6GPU3s4BA01c965wsF9rCzHQSkxU+KKtpj/oxAli9LdtgRs5AzJ/lvoPX4OtpXXzUQyR2IVG92Cxm05zMwWz1tnr2FpxsB1MXC6HqLe/tGT48qOyJWrZ/ie8OnHfgpeDE/M4ii5IIZhRxjYqOnGeKOpJiZtynPuIbBMD9dGp22PXHv0j5Gqx7+WZcVNuojlvT9Kqhi5pTd92vumZ5SRRvByvu8oaaDbeqaGVNwHMi11zZ6FqB+Jwq2PCI3YSfLvFDA6hEystV9TNFIdc3C0wj/DSOUMV6knvS4LpogiMcWQfAzIuZHiABvbULjpWPkzGcvcL8ceYKKDDiOV5OSS+jVu8LoU+5TOHbB3UHrFi5XGNwp/ZjqoKvm6wz5dSLnk0z6PfSWulfPZ1gTeYL1T6eWZq+kfEnqnABkO/DzPYbDMEqi0dcdzRwNAtc/oWDlXY7RrZxwTreA9Oz0x9PT9k51IT5VgOUPyJHY6uGWPjCrydoYloBiMW9E3YC0rvoM0uw712M+MhQMYTuQkRgjVc3lbc10aDipJLWRjjQmo/+tvKBgDeeuZ+ek8xWu4kyYIhJYtgMP/IFZf vGRmSbFG 80frHdHel9elFe/jsGnwd8Uok7JvHYAlUDQwrYU4a41S2nG3RmkWz1iwCrztS6J31yJVitsnTeIZTE9jPqscuypx91IdZIHREfXyiW/50qecuu6TsKedUk09HLl1ytjB9rK62FiLU2/IQvm74CbfnwnIrz6OvTJIfcpSICyUiBe4GY2IV+qUFXmfaEY8gWbYo9n4xDbkt8Op/0o/Pa/4FN4jrMSGciGURNFybp0C5sZk+c12L/tGj05S6kicZMJYPpBgWHM9oushofutv73TaFaGc2MfrrKcNc5+CbYo+RctGbZ9JWVJrDhA2mnI3U6UcYwoWA5O1B2edJES3LAYS6IOAD/fHewkc6v/CyjS/XpS3OtxM/N86UuatfEoMUK/JuKhKJTwgHD5ZZSc+hnpOLSbN/NPxRUgZFWg92hcVDc5A2eL4XzkThb1WmqrJ8a4FbexDnv6GSCNG2tqYaLmKdXtph6n4mp0WT73VZ0FeM4uoq4e6BbdoeMvOhV3HLuTIrea9as4lKBDFGsezbwkkQlhmUE3rHuFlid85odaOLZLmhURe96pVNONMFOW/K7pdb6oTZvIiL0oRFGP+lAhdbttlARJcrO11k0qPoHz6pAwYBpO44rnfpmWUISKgEhBJR6H5M90oA5bXxOsSZ1Vr2Qg7cejQz04CTHQw X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: vm_refcnt encodes a number of useful states: - whether vma is attached or detached - the number of current vma readers - presence of a vma writer Let's include it in the vma dump. Signed-off-by: Suren Baghdasaryan Acked-by: Vlastimil Babka --- mm/debug.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mm/debug.c b/mm/debug.c index 8d2acf432385..325d7bf22038 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -178,6 +178,17 @@ EXPORT_SYMBOL(dump_page); void dump_vma(const struct vm_area_struct *vma) { +#ifdef CONFIG_PER_VMA_LOCK + pr_emerg("vma %px start %px end %px mm %px\n" + "prot %lx anon_vma %px vm_ops %px\n" + "pgoff %lx file %px private_data %px\n" + "flags: %#lx(%pGv) refcnt %x\n", + vma, (void *)vma->vm_start, (void *)vma->vm_end, vma->vm_mm, + (unsigned long)pgprot_val(vma->vm_page_prot), + vma->anon_vma, vma->vm_ops, vma->vm_pgoff, + vma->vm_file, vma->vm_private_data, + vma->vm_flags, &vma->vm_flags, refcount_read(&vma->vm_refcnt)); +#else pr_emerg("vma %px start %px end %px mm %px\n" "prot %lx anon_vma %px vm_ops %px\n" "pgoff %lx file %px private_data %px\n" @@ -187,6 +198,7 @@ void dump_vma(const struct vm_area_struct *vma) vma->anon_vma, vma->vm_ops, vma->vm_pgoff, vma->vm_file, vma->vm_private_data, vma->vm_flags, &vma->vm_flags); +#endif } EXPORT_SYMBOL(dump_vma);