Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3611566pxu; Tue, 8 Dec 2020 17:16:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzW8Ph3K84FBivrq1OzJG70SZB8GncB8jMBgs32JoMjkKwFg0A3K4VczDOYUEy6DgIr2ySB X-Received: by 2002:a17:906:3081:: with SMTP id 1mr95659ejv.162.1607476615683; Tue, 08 Dec 2020 17:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607476615; cv=none; d=google.com; s=arc-20160816; b=eqBiHMPuEVCvdGcwIkrKj9Vvsv+GlNCpkq2NXxTflkILQbZzTIE3eiVcFHQ+ibZVFG aA9BTW7iMXH4BAoyC3yHFab86BERJJbL2aBaZWr6g7uPocckw17exIGU9tQxGJ4uVa5g C9lCGA1nOGDPzdw2qzEuBMDbGPRSBDRvM5qT5VgGk6FRYHyEvCODIJGbR843QlH2z9Ka UuB611cCUL+szwqPqIiww/42o+p7tHz/422XNc1sC8chq0RmQZ0QVSLXHFR/BuFo/e+A dOOCWq2BuojFJP95hurBEFvku+DMqWJZXNQrH5KuR/UQF5RsOQ9zOZGMNHp3h2eTY0f6 sUZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=SsG3KovFEahmouEL4AyPrd/HlFNaJtvJMNGGy/iBoJ8=; b=f3lGVxi62ldjqh8HvDTpoinHTJKqCRrTp7Yt8JlTIFaQqumbw4+Of5h/ipz6s7G5LH 8RVwwslSqY8xQ1EWQW3yl+/Js0B7XFmeoyatGKiTTvdp/+pbDFpXfGaKT/gSqc1PRMvQ kzu8qdi+FbJC38HXvid3PQ4JMRD1SEt3cA2cg/havmU38kzg98vAztd7QbG4pqOMtZ6L Gzz45fPWNxSOFLqIyzjAbKIpJma1hKjkZJYLISgxzB4/uYnzjq9QZENIl2/uQqp2HDR8 z+b4QtAuwt5wT/fsHUCCzyKsI7LAdSfLBiRue+DZ4EyL2nQB4xBeaMwxOOY64NkYzPFn eYng== ARC-Authentication-Results: i=1; mx.google.com; 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 eb11si147249edb.446.2020.12.08.17.16.32; Tue, 08 Dec 2020 17:16:55 -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; 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 S1726738AbgLIBNq (ORCPT + 99 others); Tue, 8 Dec 2020 20:13:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:37570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgLIBNq (ORCPT ); Tue, 8 Dec 2020 20:13:46 -0500 From: paulmck@kernel.org Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: rcu@vger.kernel.org Cc: 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, "Paul E. McKenney" , Christoph Lameter , Pekka Enberg , David Rientjes , linux-mm@kvack.org Subject: [PATCH v2 sl-b 2/5] mm: Make mem_dump_obj() handle NULL and zero-sized pointers Date: Tue, 8 Dec 2020 17:13:00 -0800 Message-Id: <20201209011303.32737-2-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20201209011124.GA31164@paulmck-ThinkPad-P72> References: <20201209011124.GA31164@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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)) { -- 2.9.5