Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4165337pxu; Wed, 9 Dec 2020 09:54:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhjhjfVyq7ebfptrlHYE4eD98vtrLm8INJU//GNdP941k7tb83lwu3sA2rMyPw2PUUwU15 X-Received: by 2002:a17:906:1102:: with SMTP id h2mr3053469eja.296.1607536463592; Wed, 09 Dec 2020 09:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607536463; cv=none; d=google.com; s=arc-20160816; b=QWeyd4Tf7BNkWJW8C1eNGy5egQaDc9wmamQZj9kgrcnNN3zzocjASrFsIghCCOi5AX 2BFa3VZxrxRsnerZJmvNTyNedEhUFRWuO7VLMylrD3FJ6/b2qJqIcLKeFzVzgG4IbZ9x DnIw/lOUsf7INeWUXE1GJmqgrVxFnrPWx7xnKUbJZca/9zEax+cSTynhKZXfWcWcHO/E 9w/x40UG6NBxfmun3O85NJ8GTeZyee7LJhXBaPhxvTxkraIf451rX5+VVU1Rk+reopKA +SlVa5gHkDbS2KFN3s4jMdBxqZSpPWn4uRBuzcEIT8jENvkCsfR8u7Ydlqlst7aClebe Hs3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=k8aVvJ3M+057h027s4a8smiOwuoO/xH8w7D49hkRLow=; b=PLdvIlZ2MvhB+YOXI4GeKQh1JobyGXjHsPGanwGnIOZlrFo0qEnawDLA4LF9Ry9YC5 VmnYGwNykypDZsz6RaT8xPhSquXpRc2Z+y05qUOMnD00cCd6ZYYvO9LHLuOo5DtxiNft +Vsu3MJc02X7wTScRMh84xU0MSkbhEydTcJHkeAkcjtJGM5C0Tu0oOzP4tke4HZTo33S epRDCcJKiKb1mBhww4Cm3qvEym9QOhyzuvuE3S5Ri9qUxwfKRFQTc/d5w6jtx0dXDbZV 3AmNW71WdiLJuDjAJ5y8jTR8XGDjUk3S8FzY1l/X9cBqEab0Hj0VuoYeJKnc/Bh7g/DO 9jSQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si1104031ejz.538.2020.12.09.09.54.01; Wed, 09 Dec 2020 09:54:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727905AbgLIRtm (ORCPT + 99 others); Wed, 9 Dec 2020 12:49:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:56280 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgLIRta (ORCPT ); Wed, 9 Dec 2020 12:49:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 09C7EAD0E; Wed, 9 Dec 2020 17:48:49 +0000 (UTC) Subject: Re: [PATCH v2 sl-b 2/5] mm: Make mem_dump_obj() handle NULL and zero-sized pointers To: paulmck@kernel.org, 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, Christoph Lameter , Pekka Enberg , David Rientjes , linux-mm@kvack.org References: <20201209011124.GA31164@paulmck-ThinkPad-P72> <20201209011303.32737-2-paulmck@kernel.org> From: Vlastimil Babka Message-ID: <462f135a-f8e4-6291-6c1c-4fdd2e415462@suse.cz> Date: Wed, 9 Dec 2020 18:48:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201209011303.32737-2-paulmck@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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)) { >