Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4267774pxu; Wed, 9 Dec 2020 12:33:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYu0B3i+xonLWfuivRsefkfR3xFfLyltEtMNoT7rSP/dpeNeBwaK2jQy2Y2oTqw7X5Wzj1 X-Received: by 2002:a17:906:4881:: with SMTP id v1mr3425173ejq.465.1607546027538; Wed, 09 Dec 2020 12:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607546027; cv=none; d=google.com; s=arc-20160816; b=boAtS5AGty9uKne+cW2YGF3+TCoQApAl+JO0iRSepmgHc1f+k4rlmfADTLuC8EppOe Vh5WHIEnwHoF6HmivwrsDcE5R6vZG1EuwVQ48+ki6pAJ2xafhmvoruOqsloMMF9EZ10u 0SGuOyjefO0X3Fo9+49QBnyUpVQVTWhnQrkXLfsp7MvAnjZTQxrG2xgBscmtYDTzO4oG 9lPkq023B/sSfplUFrDPsQigYD8wkxfHS2UYmU2LhrcP9o6wy+7dklfxE1uh8qT5N13P Ft286B1iViL0ygc0e+YwEJoHJMHAup/YKjoWAQYUqVIXTIAh9IpDA808Sb1jC9d6xa7M ygHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=8MclXbccqtCWfFffMRwDtHFBUhqfix9timR/9hQkzug=; b=QEfFjkPdTIAh9lTlf5K5dYz15kkJ5wNXq/7onaIOFOZNXQ9tqmi7Pvgxk91DKC3Vfa lzZc34tXAuMVuipyWbTqur9ilWHTvjITdUyTRBXw2miH2ahVIZHefDE2R96R4YT8B7xx 0T/NHI+3h2a17mqVlfxeDiNS4/Z/lSzaR7z4v046Feu7N8Ntpqvcjz2m8TGS1Kcpa0ug SiRAk1OEQAuwv/CumeGQJypKAMTUybEgI8UgYKMN/FDqI+uOOr3HVJubEJ9TKiiLWw6a XJoh0I60NRIfZ3hUeK2RpW2OsUxT9dN4s5y6bAH6EEytvZsVZZoeb/qOx6v/Pf0CyS8p ku3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iQe2+WJt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bk9si1355805ejb.252.2020.12.09.12.33.23; Wed, 09 Dec 2020 12:33:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iQe2+WJt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731262AbgLITkM (ORCPT + 99 others); Wed, 9 Dec 2020 14:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730933AbgLITkI (ORCPT ); Wed, 9 Dec 2020 14:40:08 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41AE2C0613CF; Wed, 9 Dec 2020 11:39:28 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id f24so3773112ljk.13; Wed, 09 Dec 2020 11:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8MclXbccqtCWfFffMRwDtHFBUhqfix9timR/9hQkzug=; b=iQe2+WJtOqnh/5S+VzpQP+Wz18PqcExYKhKf+5uJiIkoDoixEnqGAH0ioN13zZIEpd 92Ufy1Cd+lN+zEk0JXU7UHbVJA1DkX4wcOALq24uXS8KPxIZPwnnwbXvraUON+dPzUdN ZHT3QnU827Y5oEwwmYR6KjJImZwSsX2HOhvBYNx2MclZg7bSItg4TUFnEMzXhOlC32eG rLY1cGNRm0jL3qfg2dalUR9rsYDzvnHfeQF/M73/9TjAovbyKIhB61QGG69lf/MfCHuo ikaBduoLFVX3eiSrED8QNNxBKQPR6ui0Ie5+s1mgTMbAAguhWDvsmTV+X2lHDsP4vW6w Qtgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8MclXbccqtCWfFffMRwDtHFBUhqfix9timR/9hQkzug=; b=FqaC+TBxyOgy7hSpY9LPDGUm9F9LlX9p1q2Ejh25nIvXQG2Q9hpd/03l9vRolw1BRm 4rDvBu1iGK/4DAxiP5YJi5EhP0U6rkW1Ft3hz7bhvDj3GvoXHPlYCVo6yZwv2ZxdKlZf ZMmkujW5hxMeV7BLMXqKSBpvWVRlZkJzxnlJJ9PhNKoFwERLfeP9NOSUlUIIPAyguZsF v4jZoHXkdTHuUuJihcnaFgZg+fjNTVtaT9pZUhuAJPvuv2bPQZ/3rlIWPq8tO1Kgj8fe edBpFF0S6uZtbCjSwdkXOQxYl+5FHVqOcJBB8gPtoUe65XihMUaquvK7Sej0f5MdmJ1T Ls1g== X-Gm-Message-State: AOAM533gH1o96mZFAxdeG1BqYCZoqcZXpvOu2xI8DMm9O2pXaoIr7Udd AvsgryfnXV0NvR34ZxYIqxY= X-Received: by 2002:a2e:6c0f:: with SMTP id h15mr1696043ljc.305.1607542766736; Wed, 09 Dec 2020 11:39:26 -0800 (PST) Received: from pc638.lan (h5ef52e3d.seluork.dyn.perspektivbredband.net. [94.245.46.61]) by smtp.gmail.com with ESMTPSA id v63sm267588lfa.89.2020.12.09.11.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Dec 2020 11:39:26 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 9 Dec 2020 20:39:24 +0100 To: Vlastimil Babka , paulmck@kernel.org Cc: paulmck@kernel.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, iamjoonsoo.kim@lge.com, andrii@kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 sl-b 3/5] mm: Make mem_dump_obj() handle vmalloc() memory Message-ID: <20201209193924.GB5757@pc638.lan> References: <20201209011124.GA31164@paulmck-ThinkPad-P72> <20201209011303.32737-3-paulmck@kernel.org> <1c25ca09-ec43-df31-a5ba-476397637a53@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c25ca09-ec43-df31-a5ba-476397637a53@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 06:51:20PM +0100, Vlastimil Babka wrote: > On 12/9/20 2:13 AM, paulmck@kernel.org wrote: > > From: "Paul E. McKenney" > > > > This commit adds vmalloc() support to mem_dump_obj(). Note that the > > vmalloc_dump_obj() function combines the checking and dumping, in > > contrast with the split between kmem_valid_obj() and kmem_dump_obj(). > > The reason for the difference is that the checking in the vmalloc() > > case involves acquiring a global lock, and redundant acquisitions of > > global locks should be avoided, even on not-so-fast paths. > > > > Note that this change causes on-stack variables to be reported as > > vmalloc() storage from kernel_clone() or similar, depending on the degree > > of inlining that your compiler does. This is likely more helpful than > > the earlier "non-paged (local) memory". > > > > Cc: Andrew Morton > > Cc: Joonsoo Kim > > Cc: > > Reported-by: Andrii Nakryiko > > Signed-off-by: Paul E. McKenney > > ... > > > --- a/mm/vmalloc.c > > +++ b/mm/vmalloc.c > > @@ -3431,6 +3431,18 @@ void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) > > } > > #endif /* CONFIG_SMP */ > > > > +bool vmalloc_dump_obj(void *object) > > +{ > > + struct vm_struct *vm; > > + void *objp = (void *)PAGE_ALIGN((unsigned long)object); > > + > > + vm = find_vm_area(objp); > > + if (!vm) > > + return false; > > + pr_cont(" vmalloc allocated at %pS\n", vm->caller); > > Would it be useful to print the vm area boundaries too? > Do you mean va_start/va_end information? -- Vlad Rezki