Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4480280pxu; Wed, 9 Dec 2020 19:29:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJw750n1bFHf/D8CVUQU/MRsuXB6+UFjGveCYcB7vUsL2mLI3aVZRmF8opFv8vS4Xv18OFL1 X-Received: by 2002:a17:906:3712:: with SMTP id d18mr4801755ejc.178.1607570958624; Wed, 09 Dec 2020 19:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607570958; cv=none; d=google.com; s=arc-20160816; b=gOSRoNfE2FT1Vh8pbHgMIB6nMxT7DCec0cQeBI9cltCJNhtcBthCd5yk+gSqTfM1BO 97ec4Wl3q3o/0OL7mCDzIOiZVOFozBBUSij7k8eLzn5xXE0p7ne3WutHZSOoPwVTHAY+ ZN34usrhlZVV3Mbds2ZqYIAMDSftcum4BpouNDYc/xWJgcB2kEgkU0Ol2DCztpD8yLVb W1k/9KLmSujAT3FB4mg9kDNNhZroZK2DerVNU5icMN+8bvET3iAf4VJIKe/VUh0/CTc6 tAjj0mwGABfI1vm53HHU+4cdqShmw4lB6SL5CZwcCCeKePNJ1Q7u1V8+OjdilgAR6YcW vT9w== 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:reply-to:message-id:subject:cc:to:from :dkim-signature:date; bh=Jn4V1phFrk3xpczTNIqar00dSP5E8S87rw6JKF4ZIIE=; b=KoOolvlMRd1NP+9eVBrzo6cN6qIL8YKUIe0r+jjprtOy4GFf0o1/ToF0lQTS+XwPA3 HXdpCa3sWtD6y+6t3HQ8u7RaLJeP5dBU/L5fkvVQmdtiXoqk3ahHBDfRJu0rvISkROT/ 4EW5whJJRFw4bkvdAt99NBcEVjj0HfBYFHGAyve9nVOZ7XoCnQ0KzM/uzT9v3pI0/4oZ 6fjEKDraBpqdV5+ek2u3PkjesoXiXCEsxtil8cMP5J7OMV40Hore/TzCJ4X/XJ0RV9Jp qQSMTAXlcB4qfotHegcfVdxmRsdetHsn8fzcGPRp9za4vA2KMCkCVs7fwPgR3NMN2BWk pQkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aWqJ9s2h; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si1710603ejb.158.2020.12.09.19.28.55; Wed, 09 Dec 2020 19:29:18 -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=@kernel.org header.s=k20201202 header.b=aWqJ9s2h; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729657AbgLJD0a (ORCPT + 99 others); Wed, 9 Dec 2020 22:26:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:56922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729542AbgLJD0Q (ORCPT ); Wed, 9 Dec 2020 22:26:16 -0500 Date: Wed, 9 Dec 2020 19:25:35 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607570735; bh=xbEcoW3M2vQ+jrgz4f9vk0ksfGr4mLvgZcEgACBhBgM=; h=From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=aWqJ9s2hC652Ab2xsf+4XvRlkctf5Nj4E5uuzxq+r0pyoGTTtT9WwZMWSoRaJSuCf SFeiAko1sWkBkTs+gzNBzeZuK4kbryn+gPucqsFk4GkKjGFJJs/Vvc7dFtAgAKP8lp eP384FK3zmbtFFGvKz97B6scEhLbpwEExiq1p7Vj4mDDDfq1fgWZMaHc1xwCffwqxW 0vdunWXsmZ8Wy1iJWh1TfBf11qvkvxreI8Qmo4gInArrg3S7BJb1I9PVTMVz8FSRdV kJNujMoLN9HPaB/tX1fzXomY/qkHEvTcpazZ4+0dPdGOGYuyifLpnp2b/jkqU4CzHJ CeX8g2gM24/BQ== From: "Paul E. McKenney" To: Vlastimil Babka Cc: 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, Christoph Lameter , Pekka Enberg , David Rientjes , linux-mm@kvack.org Subject: Re: [PATCH v2 sl-b 2/5] mm: Make mem_dump_obj() handle NULL and zero-sized pointers Message-ID: <20201210032535.GR2657@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201209011124.GA31164@paulmck-ThinkPad-P72> <20201209011303.32737-2-paulmck@kernel.org> <462f135a-f8e4-6291-6c1c-4fdd2e415462@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <462f135a-f8e4-6291-6c1c-4fdd2e415462@suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 06:48:47PM +0100, Vlastimil Babka wrote: > On 12/9/20 2:13 AM, paulmck@kernel.org wrote: > > From: "Paul E. McKenney" > > > > This commit makes mem_dump_obj() call out NULL and zero-sized pointers > > specially instead of classifying them as non-paged memory. > > > > Cc: Christoph Lameter > > Cc: Pekka Enberg > > Cc: David Rientjes > > Cc: Joonsoo Kim > > Cc: Andrew Morton > > Cc: > > Reported-by: Andrii Nakryiko > > Signed-off-by: Paul E. McKenney > > Acked-by: Vlastimil Babka Applied, thank you! Thanx, Paul > > --- > > mm/util.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/mm/util.c b/mm/util.c > > index d0e60d2..8c2449f 100644 > > --- a/mm/util.c > > +++ b/mm/util.c > > @@ -985,7 +985,12 @@ int __weak memcmp_pages(struct page *page1, struct page *page2) > > void mem_dump_obj(void *object) > > { > > if (!virt_addr_valid(object)) { > > - pr_cont(" non-paged (local) memory.\n"); > > + if (object == NULL) > > + pr_cont(" NULL pointer.\n"); > > + else if (object == ZERO_SIZE_PTR) > > + pr_cont(" zero-size pointer.\n"); > > + else > > + pr_cont(" non-paged (local) memory.\n"); > > return; > > } > > if (kmem_valid_obj(object)) { > > >