From nobody Mon Feb 9 13:00:43 2026 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E761C1DA10E for ; Thu, 26 Dec 2024 17:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735232864; cv=none; b=P805nDE6wd33SVI7J6KRrQD0Xem0nFCKXOQNm2Q/8TySadoHQdcD93nmysZvEQ576Pp7RDdXCuzDppMoA1iF3yIJgfPWrMrN7xDfO5x4osFF3RcfzZs3G/xC0ThRQqXlTIYvbDfRKfcAukxjrQaI3PG81lTkRpCFhLUZiZIcHdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735232864; c=relaxed/simple; bh=bbw6pVuUSpPlySGCFqTY1teRdTcfZlASZvWIhGr3QJ8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=t8PePPOU1AhyfsV+0RngZMP2FgZka+94gfh0zxiW5U2GIX1pN/BSpTZtnptKBzqBaU06D0Szf4TtCvoJZbyJrE/TAfY3CT7la71Tx+ZAMadZSKmk39L+tjL5nJpONT2+zNpEfm0tKTcHSblf/roOyQPlzFiMC8Vte6Em6hvt0WU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ksvurq5q; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ksvurq5q" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2f2a9f056a8so8306432a91.2 for ; Thu, 26 Dec 2024 09:07:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1735232860; x=1735837660; darn=vger.kernel.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=ZbUgy+N8PHmQQlIfNLhjvtNZcxZdtPERK00HNSuusW4=; b=ksvurq5qiBjeu67KSoT4ll2+LZ/X9topEPcjJ19pie9Cm4RS6UuSTHOnzBe+kFN7MD UImVTe0q1jiZxXga3H8aDOSWvcDcLxizf2qUa2lbyoJrxYpyohnagMLfLVQeqazVTPnZ U0uzArnWskFLDbELXh3o6NdWvttgj+JVmh9YMUy6C/LU6KzEbvnddooU69noy1P0TywV rwQdvTU8tHCsNGgS0NC/CYChnu3jHPPCZL7XETVeNXee00IX62Tg2OfheV5f4QU2zsdC bgMhXQjvdn1lZiflZSkJ9lCPOXG8TmWOLr3Uz1Gj5Qh2YNF0vnseLMfn0UpzyZRp18y3 g3rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735232860; x=1735837660; 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=ZbUgy+N8PHmQQlIfNLhjvtNZcxZdtPERK00HNSuusW4=; b=RQK9sr6Gqjs2N6haRekYqyuS7/Io7QMvL/REgJCFD90wTolhy5DsITjrYcgkRjseZv ZsUkyhspFUXwINAA4055irLFszZW1U5LYv1PearXuO9aUJCPtLdtDYcQApoz/1tfTVUC MD0uEZULYwjcEl5YXKdg7/ak9oxiyhZ1/jFQQHGgygex3HpicXR1I8IqT6EUJaozsFtY eSPUlvTU4fzHuSO3Kv3XibeioxMON/6hKV7vgEGNnLXYEvTOZmKLaFxakLO29SCYRPNW tQxKtbY1aIVGdkQUIaBX4y6f33IWL5FDj5k0mjFk0X5RTjRZQ0VM6vJeo7Ekq+KnfBB3 UXlA== X-Forwarded-Encrypted: i=1; AJvYcCViE0QJGYxUwIv8xqOkhXNuYLgIWpKw/nWslREhf+6B6gVm4rxQef5Q2lV+C1jqGVieiw3qafz+6/rheXY=@vger.kernel.org X-Gm-Message-State: AOJu0YyZ0IqaXO4uzcGTkV1ZGAnBhy27CL5wZoZVvbdw413vq0MrfN3D SkFJ1Y8Db0Ht/mf+t46durDmdAnH/RKO90Btmcw02J1R1JpJFa1OZVK2WZmx7Qz89ZNR6vOiW8t sSw== X-Google-Smtp-Source: AGHT+IEG5TzQ5WphA3eoGz/MbiJJmFDDNhcID7zswYwLoeBJDVpj8ipi2aVpjRu++rbXJdGfCBLbRXGohaw= X-Received: from pfbdc3.prod.google.com ([2002:a05:6a00:35c3:b0:725:cd3b:326c]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:8412:b0:1e1:a671:7122 with SMTP id adf61e73a8af0-1e5e044635dmr39159145637.2.1735232860104; Thu, 26 Dec 2024 09:07:40 -0800 (PST) Date: Thu, 26 Dec 2024 09:07:05 -0800 In-Reply-To: <20241226170710.1159679-1-surenb@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241226170710.1159679-1-surenb@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241226170710.1159679-14-surenb@google.com> Subject: [PATCH v7 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, 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, corbet@lwn.net, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com, surenb@google.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- mm/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/debug.c b/mm/debug.c index 95b6ab809c0e..68b3ba3cf603 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -181,12 +181,12 @@ void dump_vma(const struct vm_area_struct *vma) 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)\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); + vma->vm_flags, &vma->vm_flags, refcount_read(&vma->vm_refcnt)); } EXPORT_SYMBOL(dump_vma); =20 --=20 2.47.1.613.gc27f4b7a9f-goog