linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Sasha Levin <sasha.levin@oracle.com>,
	Dave Hansen <dave.hansen@intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] mm: generalize VM_BUG_ON() macros
Date: Thu,  2 Oct 2014 17:11:33 +0300 (EEST)	[thread overview]
Message-ID: <20141002141133.B56A6E00A3@blue.fi.intel.com> (raw)
In-Reply-To: <20141001130523.d7cf46e735089d681194e8e6@linux-foundation.org>

Andrew Morton wrote:
> On Wed,  1 Oct 2014 14:31:59 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
> 
> > This patch makes VM_BUG_ON() to accept one to three arguments after the
> > condition. Any of these arguments can be page, vma or mm. VM_BUG_ON()
> > will dump info about the argument using appropriate dump_* function.
> > 
> > It's intended to replace separate VM_BUG_ON_PAGE(), VM_BUG_ON_VMA(),
> > VM_BUG_ON_MM() and allows additional use-cases like:
> > 
> >   VM_BUG_ON(cond, vma, page);
> >   VM_BUG_ON(cond, vma, src_page, dst_page);
> >   VM_BUG_ON(cond, mm, src_vma, dst_vma);
> >   ...
> 
> I can't say I'm a fan of this.  We don't do this sort of thing anywhere
> else in the kernel and passing different types to the same thing in
> different places is unusual and exceptional.  We gain very little from
> this so why bother?

We had bug like this: lkml.kernel.org/r/53F487EB.7070703@oracle.com where
it's useful to see more than one structure dumped: vma + page in this
case.

We can keep inventing new macros: VM_BUG_ON_PAGE_AND_VM() for the case.
But why not have one to rule them all? ;)

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-10-02 14:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 11:31 Kirill A. Shutemov
2014-10-01 11:32 ` [PATCH 2/3] mm: use VM_BUG_ON instead of VM_BUG_ON_PAGE everywhere Kirill A. Shutemov
2014-10-01 11:32 ` [PATCH 3/3] mm: use VM_BUG_ON() instead of VM_BUG_ON_VMA() and VM_BUG_ON_MM() Kirill A. Shutemov
2014-10-01 11:39 ` [PATCH 1/3] mm: generalize VM_BUG_ON() macros Sasha Levin
2014-10-01 13:18   ` Kirill A. Shutemov
2014-10-01 20:05 ` Andrew Morton
2014-10-02 14:11   ` Kirill A. Shutemov [this message]
2014-10-02 17:03   ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141002141133.B56A6E00A3@blue.fi.intel.com \
    --to=kirill.shutemov@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sasha.levin@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox