linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: 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: Wed, 01 Oct 2014 07:39:33 -0400	[thread overview]
Message-ID: <542BE7F5.2000808@oracle.com> (raw)
In-Reply-To: <1412163121-4295-1-git-send-email-kirill.shutemov@linux.intel.com>

On 10/01/2014 07:31 AM, Kirill A. Shutemov wrote:
> +#define _VM_DUMP(arg, cond) do {					\
> +	if (__builtin_types_compatible_p(typeof(*arg), struct page))	\
> +		dump_page((struct page *) arg,				\
> +				"VM_BUG_ON(" __stringify(cond)")");	\
> +	else if (__builtin_types_compatible_p(typeof(*arg),		\
> +				struct vm_area_struct))			\
> +		dump_vma((struct vm_area_struct *) arg);		\
> +	else if (__builtin_types_compatible_p(typeof(*arg),		\
> +				struct mm_struct))			\
> +		dump_mm((struct mm_struct *) arg);			\
> +	else								\
> +		BUILD_BUG();						\
> +} while(0)

__same_type() instead of __builtin_types_compatible_p() would look nicer,
but I don't think that all compilers support that:

	include/linux/compiler-intel.h:/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */

So it would effectively disable VM_BUG_ONs on Intel's compiler.


Thanks,
Sasha

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

  parent reply	other threads:[~2014-10-01 11:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 11:31 [PATCH 1/3] mm: generalize VM_BUG_ON() macros 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 ` Sasha Levin [this message]
2014-10-01 13:18   ` [PATCH 1/3] mm: generalize VM_BUG_ON() macros Kirill A. Shutemov
2014-10-01 20:05 ` Andrew Morton
2014-10-02 14:11   ` Kirill A. Shutemov
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=542BE7F5.2000808@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).