linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Shi, Yang" <yang.shi@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>, linaro-kernel@lists.linaro.org
Cc: akpm@linux-foundation.org, iamjoonsoo.kim@lge.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: fix build problems from lookup_page_ext
Date: Tue, 24 May 2016 09:33:30 -0700	[thread overview]
Message-ID: <2886daa5-bff5-34d1-956a-ea6fe718bcae@linaro.org> (raw)
In-Reply-To: <6285269.2CksypHdYp@wuerfel>

Hi Arnd,

Thanks a lot for the patch. My bad, sorry for the inconvenience. I 
omitted the specific page_idle change is for 32 bit only.

And, my host compiler looks old which is still 4.8 so it might not catch 
the warning. I will update my compiler.

Regards,
Yang


On 5/24/2016 3:08 AM, Arnd Bergmann wrote:
> A patch for lookup_page_ext introduced several build errors and
> warnings, e.g.
>
> mm/page_owner.c: In function '__set_page_owner':
> mm/page_owner.c:71:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
> include/linux/page_idle.h: In function 'set_page_young':
> include/linux/page_idle.h:62:3: error: expected ')' before 'return'
>
> This fixes all of them. Please fold into the original patch.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 38c4fffbad3c ("mm: check the return value of lookup_page_ext for all call sites")
>
> diff --git a/include/linux/page_idle.h b/include/linux/page_idle.h
> index 569c3a180625..fec40271339f 100644
> --- a/include/linux/page_idle.h
> +++ b/include/linux/page_idle.h
> @@ -48,7 +48,7 @@ static inline bool page_is_young(struct page *page)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
>
> -	if (unlikely(!page_ext)
> +	if (unlikely(!page_ext))
>  		return false;
>
>  	return test_bit(PAGE_EXT_YOUNG, &page_ext->flags);
> @@ -58,7 +58,7 @@ static inline void set_page_young(struct page *page)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
>
> -	if (unlikely(!page_ext)
> +	if (unlikely(!page_ext))
>  		return;
>
>  	set_bit(PAGE_EXT_YOUNG, &page_ext->flags);
> @@ -68,7 +68,7 @@ static inline bool test_and_clear_page_young(struct page *page)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
>
> -	if (unlikely(!page_ext)
> +	if (unlikely(!page_ext))
>  		return false;
>
>  	return test_and_clear_bit(PAGE_EXT_YOUNG, &page_ext->flags);
> @@ -78,7 +78,7 @@ static inline bool page_is_idle(struct page *page)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
>
> -	if (unlikely(!page_ext)
> +	if (unlikely(!page_ext))
>  		return false;
>
>  	return test_bit(PAGE_EXT_IDLE, &page_ext->flags);
> @@ -88,7 +88,7 @@ static inline void set_page_idle(struct page *page)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
>
> -	if (unlikely(!page_ext)
> +	if (unlikely(!page_ext))
>  		return;
>
>  	set_bit(PAGE_EXT_IDLE, &page_ext->flags);
> @@ -98,7 +98,7 @@ static inline void clear_page_idle(struct page *page)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
>
> -	if (unlikely(!page_ext)
> +	if (unlikely(!page_ext))
>  		return;
>
>  	clear_bit(PAGE_EXT_IDLE, &page_ext->flags);
> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index 902e39813295..c6cda3e36212 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -65,9 +65,6 @@ void __set_page_owner(struct page *page, unsigned int order, gfp_t gfp_mask)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
>
> -	if (unlikely(!page_ext))
> -		return;
> -
>  	struct stack_trace trace = {
>  		.nr_entries = 0,
>  		.max_entries = ARRAY_SIZE(page_ext->trace_entries),
> @@ -75,6 +72,9 @@ void __set_page_owner(struct page *page, unsigned int order, gfp_t gfp_mask)
>  		.skip = 3,
>  	};
>
> +	if (unlikely(!page_ext))
> +		return;
> +
>  	save_stack_trace(&trace);
>
>  	page_ext->order = order;
> @@ -111,12 +111,11 @@ void __copy_page_owner(struct page *oldpage, struct page *newpage)
>  {
>  	struct page_ext *old_ext = lookup_page_ext(oldpage);
>  	struct page_ext *new_ext = lookup_page_ext(newpage);
> +	int i;
>
>  	if (unlikely(!old_ext || !new_ext))
>  		return;
>
> -	int i;
> -
>  	new_ext->order = old_ext->order;
>  	new_ext->gfp_mask = old_ext->gfp_mask;
>  	new_ext->nr_entries = old_ext->nr_entries;
> @@ -204,11 +203,6 @@ err:
>  void __dump_page_owner(struct page *page)
>  {
>  	struct page_ext *page_ext = lookup_page_ext(page);
> -	if (unlikely(!page_ext)) {
> -		pr_alert("There is not page extension available.\n");
> -		return;
> -	}
> -
>  	struct stack_trace trace = {
>  		.nr_entries = page_ext->nr_entries,
>  		.entries = &page_ext->trace_entries[0],
> @@ -216,6 +210,11 @@ void __dump_page_owner(struct page *page)
>  	gfp_t gfp_mask = page_ext->gfp_mask;
>  	int mt = gfpflags_to_migratetype(gfp_mask);
>
> +	if (unlikely(!page_ext)) {
> +		pr_alert("There is not page extension available.\n");
> +		return;
> +	}
> +
>  	if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) {
>  		pr_alert("page_owner info is not active (free page?)\n");
>  		return;
>

--
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:[~2016-05-24 16:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 17:16 [PATCH] mm: check the return value of lookup_page_ext for all call sites Yang Shi
2016-05-24  2:58 ` Minchan Kim
2016-05-26  0:37   ` Minchan Kim
2016-05-26 23:15     ` Shi, Yang
2016-05-27  5:14       ` Minchan Kim
2016-05-27  6:08         ` Joonsoo Kim
2016-05-27  8:11           ` Minchan Kim
2016-05-27 18:16             ` Shi, Yang
2016-05-30  6:11               ` Minchan Kim
2016-06-01 20:40                 ` Shi, Yang
2016-06-02  5:00                   ` Minchan Kim
2016-06-02 23:15                     ` Shi, Yang
2016-05-30  5:39             ` Joonsoo Kim
2016-05-30  6:08               ` Minchan Kim
2016-06-01 20:52                 ` Shi, Yang
2016-05-27 20:02       ` Andrew Morton
2016-05-27 20:17         ` Shi, Yang
2016-05-27 20:30           ` Andrew Morton
2016-05-24 10:08 ` [PATCH] mm: fix build problems from lookup_page_ext Arnd Bergmann
2016-05-24 16:33   ` Shi, Yang [this message]
2016-05-25  7:12 ` [PATCH] mm: check the return value of lookup_page_ext for all call sites shakil
2016-05-30  6:17 ` Minchan Kim

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=2886daa5-bff5-34d1-956a-ea6fe718bcae@linaro.org \
    --to=yang.shi@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linaro-kernel@lists.linaro.org \
    --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).