Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1180314

Re: [PATCH 05/11] mm: debug: dump page into a string rather than directly on screen

From David Rientjes <rientjes@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH 05/11] mm: debug: dump page into a string rather than directly on screen
Date 2015-07-09 02:00 +0200
Message-ID <pK7pU-1br-15@gated-at.bofh.it> (permalink)
References (1 earlier) <pq4XE-6ml-15@gated-at.bofh.it> <pHdia-59-5@gated-at.bofh.it> <pHvRL-Md-13@gated-at.bofh.it> <pHxJV-23b-61@gated-at.bofh.it> <pHz90-2TW-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 1 Jul 2015, Sasha Levin wrote:

> Since we'd BUG at VM_BUG_ON(), this would be something closer to:
> 
> 	if (unlikely(compound_head(page) != head)) {
> 		dump_page(page);
> 		dump_page(head);
> 		VM_BUG_ON(1);
> 	}
> 

I was thinking closer to

	if (VM_WARN_ON(compound_head(page) != head)) {
		...
		BUG();
	}

so we prefix all output with the typical warning diagnostics, emit 
whatever page, vma, etc output we want, and then finally die.  The final 
BUG() here would have to be replaced by something that suppresses the 
repeated output.

If it's really just a warning, then no BUG() needed.

> But my point here was that while one *could* do it that way, no one does because
> it's not intuitive. We both agree that in the example above it would be useful to
> see both 'page' and 'head', and yet the code that was written didn't dump any of
> them. Why? No one wants to write debug code unless it's easy and short.
> 

pr_alert("%pZp %pZv", page, vma) isn't shorter than dump_page(page); 
dump_vma(vma), but it would be a line shorter.  I'm not sure that the 
former is easier, though, and it prevents us from ever expanding dump_*() 
functions for conditional output.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH 05/11] mm: debug: dump page into a string rather than  directly on screen David Rientjes <rientjes@google.com> - 2015-07-01 23:30 +0200
  Re: [PATCH 05/11] mm: debug: dump page into a string rather than  directly on screen "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-07-01 23:40 +0200
  Re: [PATCH 05/11] mm: debug: dump page into a string rather than  directly on screen Vlastimil Babka <vbabka@suse.cz> - 2015-07-02 00:40 +0200
  Re: [PATCH 05/11] mm: debug: dump page into a string rather than  directly on screen Sasha Levin <sasha.levin@oracle.com> - 2015-07-02 01:00 +0200
    Re: [PATCH 05/11] mm: debug: dump page into a string rather than  directly on screen David Rientjes <rientjes@google.com> - 2015-07-09 02:00 +0200

csiph-web