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


Groups > linux.kernel > #1201828 > unrolled thread

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

Started bySasha Levin <sasha.levin@oracle.com>
First post2015-08-06 17:10 +0200
Last post2015-08-06 17:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 05/11] mm: debug: dump page into a string rather than  directly on screen Sasha Levin <sasha.levin@oracle.com> - 2015-08-06 17:10 +0200

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

FromSasha Levin <sasha.levin@oracle.com>
Date2015-08-06 17:10 +0200
SubjectRe: [PATCH 05/11] mm: debug: dump page into a string rather than directly on screen
Message-ID<pUuXT-4cV-13@gated-at.bofh.it>
On 07/08/2015 07:58 PM, David Rientjes wrote:
> 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.

How is that simpler than getting it all under VM_BUG()? Just like the regular
WARN() does.

>> > 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.

I'm not objecting to leaving dump_*() for these trivial cases.


Thanks,
Sasha
--
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/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web