From patchwork Thu Dec 26 17:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13921394 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 1D415E7718E for ; Thu, 26 Dec 2024 17:07:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7B436B00A6; Thu, 26 Dec 2024 12:07:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BDBCA6B00A5; Thu, 26 Dec 2024 12:07:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2D7F6B00A6; Thu, 26 Dec 2024 12:07:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 83FDA6B00A4 for ; Thu, 26 Dec 2024 12:07:43 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 348651A11FF for ; Thu, 26 Dec 2024 17:07:43 +0000 (UTC) X-FDA: 82937740746.22.77431A9 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) by imf27.hostedemail.com (Postfix) with ESMTP id 019F840019 for ; Thu, 26 Dec 2024 17:06:55 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=h2AILnRL; spf=pass (imf27.hostedemail.com: domain of 3XI1tZwYKCG8fheRaOTbbTYR.PbZYVahk-ZZXiNPX.beT@flex--surenb.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3XI1tZwYKCG8fheRaOTbbTYR.PbZYVahk-ZZXiNPX.beT@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=1735232841; 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=ZbUgy+N8PHmQQlIfNLhjvtNZcxZdtPERK00HNSuusW4=; b=rW/FXDeCkHVv5M/ayDVqzo3uI1tllEqWLSfXiXJvvgVDgIx92jj4mGSyIW7YxOi/BCswLG 7z6VZEHBBWLDdLLrM0yqIrBD3Ffk6Z4z0YisKMlqnR2GL+i/OIYM6FQShhE/GgDIRuj+/r O00BoEjpYDJOzLhjdpuIFfK0YBop2Hc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735232841; a=rsa-sha256; cv=none; b=lkVPyzhln9d8yBiwBeWGPkpHZGFCxIucfx1GvNnQPx9/EnMKhm5owtOq6m5ASWL7hE6jh4 ZRJfNrM66xPcKwygiqy0CiBhwrJoR+vjkJO9idFwaGiqchUNn0rMVM0u8N+vky9B63fVrf JT9ypLDx6tdlPUpbo6c74/W5ocYAA5I= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=h2AILnRL; spf=pass (imf27.hostedemail.com: domain of 3XI1tZwYKCG8fheRaOTbbTYR.PbZYVahk-ZZXiNPX.beT@flex--surenb.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3XI1tZwYKCG8fheRaOTbbTYR.PbZYVahk-ZZXiNPX.beT@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2efa0eb9dacso8311620a91.1 for ; Thu, 26 Dec 2024 09:07:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1735232860; x=1735837660; 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=ZbUgy+N8PHmQQlIfNLhjvtNZcxZdtPERK00HNSuusW4=; b=h2AILnRLH5Z1safT9oAtHv1a5eNXsiIZD9TPXkwIsX60OWB/HMxzmgRXXbUvv4Ct56 6rpjwBubnr32h4GvTTs9OgscgG8C/NKa4eQ5P4LHw+Jiob55JU+mMPGMC4n0o4I+uXsV IlMc8vujN2XZ2A0Ua358kVFgMKN+MS00GS/gL2dAnmSgmmqtWj4bSZCO5Yb3uKLKA58J oAFMSzShhltdsJHw5XsnCL4zg1y+SKUh0e7CfyXCtP9/4dlxGLCU2RsutknEKIx68IgI naSnTFUmHIbBhbDzW0s1TKolOqvun8nltT/grJQL4wB79yJuOARr2PoyLQFEJasMx9PI mwiQ== 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=WUIE5fAAyVrNVzoE3LnYfnZmNOpiI3CFiDvEljAUMKU14QbxLHEkfujEZp9r6mFIHn dNEjJf3g6UY3W2Tm0c7DY5Erev4uPJXlM8IdGE5pis57VC0BPWY3cDUFQa7S53i+7am5 p2DbtQuYncUcSycrpf/JNutFS0uQyz8gLtl898LChgePWNBufA+O4lZUuP+1Bnur1Jgm I27IlY5BxTReybqJNoWfvs4EECNOJoHDaEipsIXFfGqEClAOTHcAGXVqBevGZ7YSK+Of w8b5eFvj4iGJTm9KqGYGd3ju6OErZyWzalVbMYOaTTkWEhhMNoBCxUZdmvX7iElpx6b0 /cnQ== X-Forwarded-Encrypted: i=1; AJvYcCWW+vYnQ5R4UooOeuSINbMc7fIbZ5yS4fAcBT3AssZtexeYe8mw0YBg508ZkuiHDZO2EUnBBYQzJg==@kvack.org X-Gm-Message-State: AOJu0YyFONAeSglBQ5ufnLI63WOnRB76Z7lEWNn/egl2SKYfgWTzph/G sRUGpPxbfdM5Izlah3A1J0G4l2Bj50OgRFnrEDivV+l2s3MaVxrt8cmldMQ+i8PyewiKxP+vCeU Apg== 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> 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 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 019F840019 X-Stat-Signature: apybebo1xwz3c46n3qu965jfqncwfc1p X-Rspam-User: X-HE-Tag: 1735232815-676348 X-HE-Meta: U2FsdGVkX1+FME2n29F948tdwWNmoN4Z6Q4NtMXhlmXmypRJYLckgxL6kKs0CpBvFB+6sJWQi1YP3a3GaKYwIa05JdPJGOG4GhBy2ppxhBzl4d3Eem/n+RY8WY+41VVXOtrVUJbh4bYUca/hcd28FDp3WaLPntIJ9LwaKqnYcrl5D+vZnvFhZwVvyqTXtF52SK3UHdfnomVdJhHmxO9G2Q0sRsjYCCCC+A4OPrQaNQkyTKwGLsKDGnfCqxmanelKjJ84+3aINymjtvq3mc0rIdZveTuvi+tYhgofEfkTo+0jWdPuBuJ0H3t6EWtogJ6LHmZeO7c2bfgfxBOZgBdlZeTvZdlKBPNJdqT0CvxFlIh01P4na3NGOLVWhPiPbwO5LhjmQX9G5khwcMLJuLvF9b4VGOBCkrT3YE+fZJKrrulFEiub4yn7owmMGjVf0yz49IVGIcnA1GJ8892obZofjwFsJO3Ifd8l48pio77ixW7p2a/8pVLtUf3bH7+h9h0MZMoAdj3rfjw6ZCwuL+UKYPkJnLrMPIM0raupY0kHj63D4c+qmfDtj9t7He+5RMS4IdwV+2SnhNOEKl6cgpGcSaCg+uN7A4Iozwrm84Y+pY9oOWLT1dAD0+Z/Jxlj5uvsPL8WUezCICUxNcq+7m5LjaoIgkk91KqQ7y9b2VFIgdNXLFZ5qmuEgmgjafp09Ddevx3xLPIdAufErIF7btLOPvWSJmyJdIIzTwee7uNlGfYJCoGH7HB33/yGF+W6PvOSMTVPuXdFvbeagh3+z753/Owip5fNUJeGym80IMkHWcD8XSBadeQzNmR+1lJddblZ4iuKZYf4BUIGmUyI/TySkonZ/FWJt9zs0WY1qj4qeXojNJEoHYv90bamzvTuEzedz1K+QJEZscaaHLqextjb7GnbiT7YF3BUJn5GoFCv4TA4EOkG9r9qqUUx00SFWoRLaz3El9+RhazfqdIB0Sg js1cDcZQ Q+rqueYeHENpYjFK0RZje+0qjgOgJplsAkruZOJwNqT4ITMhfP6tCuBGDPPIFgoNnoRKkB3md2LZmHQXOm1lpxVS8Ctz555GEop87wBkMLnRP8jQZKRqMRMgUS4dIuHRGSUfis5tEPIqZo+8zo2/9QewEOKAldnXdYH+5z4DFTgpf02XHOs58Xfg345sQNifNgCUCAmPIPmjtCP8WVv9uppzXhTP8bQ/g7MGvIGYzWY8qYMGg8fLWacx222d/pH1VZ7TxPQvWC0QTmlQwtkFqfMAO6sGFpLQUjJb8YBK7dO+aCcb/kyPVLGS2U84Dh0p4RaJDKtKrijD4SqCiIGGmIlEAHDwXR0V512wWtGRzwOUbIscArzk0mi13iiQmwhO43yItZDoZEgUzZi4uPBs0CJAI83pZFAY4xhxs0OpvwSojy4UrvFONyLDgYYVvkRh7boK+ZiXrrm6LfB0N96dEq2mVKSsxtggZygvAOrwcpNmnsxlC/vhdJrc+81jXthvthilYtck98MhOYB5PlLLFIgYfohql8cQ5lCOe3GoQOkst3QDHyaBKOq0WIIU4WpuWk+Fjl+hMGfJd/PsolFKGUYJV9g== 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: 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 --- 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);