linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: rohit.seth@intel.com, akpm@osdl.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: Clean up of __alloc_pages
Date: Sat, 29 Oct 2005 19:19:46 -0700	[thread overview]
Message-ID: <20051029191946.1832adaf.pj@sgi.com> (raw)
In-Reply-To: <4364296E.1080905@yahoo.com.au>

Nick, replying to pj:
> >  3) The "inline" you added to buffered_rmqueue() blew up my compile.
> 
> How? Why? This should be solved because a future possible feature
> (early allocation from pcp lists) will want inlining in order to
> propogate the constant 'replenish' argument.

If I make the following change to a copy of mm/page_alloc.c:

=================================
--- 2.6.14-rc5-mm1-cpuset-patches.orig/mm/page_alloc.c  2005-10-29 19:04:13.745641793 -0700
+++ 2.6.14-rc5-mm1-cpuset-patches/mm/page_alloc.c       2005-10-29 19:04:03.085367810 -0700
@@ -713,7 +713,7 @@ static inline void prep_zero_page(struct
  * we cheat by calling it from here, in the order > 0 path.  Saves a branch
  * or two.
  */
-struct page *
+struct inline page *
 buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags)
 {
 	unsigned long flags;
=================================

Then it goes from compiling ok, to failing with 61 lines of
error output, beginning with:

mm/page_alloc.c:716: error: parse error before "inline"
mm/page_alloc.c:721: error: `gfp_flags' undeclared here (not in a function)
mm/page_alloc.c:723: error: parse error before "if"
mm/page_alloc.c:726: warning: type defaults to `int' in declaration of `pcp'
mm/page_alloc.c:726: error: `zone' undeclared here (not in a function)
mm/page_alloc.c:726: error: braced-group within expression allowed only inside a function
mm/page_alloc.c:726: warning: data definition has no type or storage class
mm/page_alloc.c:726: warning: type defaults to `int' in declaration of `debug_smp_processor_id'
mm/page_alloc.c:726: warning: function declaration isn't a prototype
mm/page_alloc.c:726: error: conflicting types for `debug_smp_processor_id'
include/linux/smp.h:131: error: previous declaration of `debug_smp_processor_id'          

This is gcc 3.3.3, compiling sn2_defconfig on and for an SN2.

Perhaps "inline struct page *" would work better than "struct inline page *" ?
... yes ... that fixes my compiler complaints.

Also ... buffered_rmqueue() is a rather large function to be inlining.
And if it is inlined, then are you expecting to also have an out of
line copy, for use by the call to it from mm/swap_prefetch.c
prefetch_get_page()?

Adding the 'inline' keyword increases my kernel text size by
1448 bytes, for the extra copy of this code used inline from
the call to it from mm/page_alloc.c:get_page_from_freelist().
Is that really worth it?

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

--
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:[~2005-10-30  2:19 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-29  1:33 Rohit, Seth
2005-10-29  2:33 ` Nick Piggin
2005-10-31 20:55   ` Rohit Seth
2005-11-01  1:14     ` Nick Piggin
2005-11-04 18:15       ` Rohit Seth
2005-11-05  0:00         ` Nick Piggin
2005-10-30  0:16 ` Paul Jackson
2005-10-31 19:09   ` Rohit Seth
2005-11-05 17:09   ` Andi Kleen
2005-11-06  4:18     ` Paul Jackson
2005-11-06 17:35       ` Andi Kleen
2005-11-06 20:49         ` Paul Jackson
2005-11-07  2:57           ` Nick Piggin
2005-11-07  3:42             ` Andi Kleen
2005-11-07  4:37               ` Paul Jackson
2005-11-07  6:08                 ` Nick Piggin
2005-11-07  9:46                   ` Paul Jackson
2005-11-07 10:17                     ` Nick Piggin
2005-11-07 14:41                       ` Paul Jackson
2005-11-07  3:44             ` Paul Jackson
2005-10-30  1:47 ` Paul Jackson
2005-10-30  2:01   ` Nick Piggin
2005-10-30  2:19     ` Paul Jackson [this message]
2005-10-30  2:32       ` Nick Piggin
2005-10-30  3:06         ` Paul Jackson
2005-10-30  3:53           ` Nick Piggin
2005-10-30  2:26     ` Paul Jackson
2005-10-30  2:36       ` Nick Piggin
2005-10-30  3:09         ` Paul Jackson
2005-10-30  3:55           ` Nick Piggin
2005-10-30  4:11             ` Paul Jackson
2005-10-31 21:20   ` Rohit Seth
2005-10-31 21:28     ` Paul Jackson
  -- strict thread matches above, loose matches on Subject: below --
2005-11-05  1:57 Seth, Rohit
2005-10-01 19:00 Seth, Rohit
2005-10-02  3:09 ` Nick Piggin
2005-10-03 16:50   ` Rohit Seth
2005-10-03 15:34 ` Christoph Lameter
2005-10-03 16:55   ` Rohit Seth
2005-10-03 16:57     ` Christoph Lameter
2005-10-03 17:48       ` Rohit Seth
2005-10-04 13:27         ` Andi Kleen
2005-10-04 16:26           ` Ray Bryant
2005-10-04 16:10             ` Martin J. Bligh
2005-10-04 17:02               ` Ray Bryant

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=20051029191946.1832adaf.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rohit.seth@intel.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