All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mm/filemap.c: ra_submit inline
@ 2014-03-20 21:53 Fabian Frederick
  2014-03-20 21:58 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-03-20 21:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

f9acc8c7b35a10 ("readahead: sanify file_ra_state names")
left ra_submit with a single function call.

Add 'inline' to save some stack (suggested by Andrew Morton).

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 mm/readahead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/readahead.c b/mm/readahead.c
index 0de2360..ce8de09 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -246,7 +246,7 @@ unsigned long max_sane_readahead(unsigned long nr)
 /*
  * Submit IO for the read-ahead request in file_ra_state.
  */
-unsigned long ra_submit(struct file_ra_state *ra,
+inline unsigned long ra_submit(struct file_ra_state *ra,
 		       struct address_space *mapping, struct file *filp)
 {
 	int actual;
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] mm/filemap.c: ra_submit inline
  2014-03-20 21:53 [PATCH 1/1] mm/filemap.c: ra_submit inline Fabian Frederick
@ 2014-03-20 21:58 ` Andrew Morton
  2014-03-21 16:20   ` Fabian Frederick
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2014-03-20 21:58 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel

On Thu, 20 Mar 2014 22:53:25 +0100 Fabian Frederick <fabf@skynet.be> wrote:

> f9acc8c7b35a10 ("readahead: sanify file_ra_state names")
> left ra_submit with a single function call.
> 
> Add 'inline' to save some stack (suggested by Andrew Morton).
> 
> --- a/mm/readahead.c
> +++ b/mm/readahead.c
> @@ -246,7 +246,7 @@ unsigned long max_sane_readahead(unsigned long nr)
>  /*
>   * Submit IO for the read-ahead request in file_ra_state.
>   */
> -unsigned long ra_submit(struct file_ra_state *ra,
> +inline unsigned long ra_submit(struct file_ra_state *ra,
>  		       struct address_space *mapping, struct file *filp)
>  {
>  	int actual;

The ra_submit() callsite in filemap.c will not be able to inline this
function because its definition is unavailable at compilation time.

ra_submit() should be made static inline and moved into a header file
which all callers include.  Probably in mm.h's /* readahead */ section.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] mm/filemap.c: ra_submit inline
  2014-03-20 21:58 ` Andrew Morton
@ 2014-03-21 16:20   ` Fabian Frederick
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Frederick @ 2014-03-21 16:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On Thu, 20 Mar 2014 14:58:29 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Thu, 20 Mar 2014 22:53:25 +0100 Fabian Frederick <fabf@skynet.be> wrote:
> 
> > f9acc8c7b35a10 ("readahead: sanify file_ra_state names")
> > left ra_submit with a single function call.
> > 
> > Add 'inline' to save some stack (suggested by Andrew Morton).
> > 
> > --- a/mm/readahead.c
> > +++ b/mm/readahead.c
> > @@ -246,7 +246,7 @@ unsigned long max_sane_readahead(unsigned long nr)
> >  /*
> >   * Submit IO for the read-ahead request in file_ra_state.
> >   */
> > -unsigned long ra_submit(struct file_ra_state *ra,
> > +inline unsigned long ra_submit(struct file_ra_state *ra,
> >  		       struct address_space *mapping, struct file *filp)
> >  {
> >  	int actual;
> 
> The ra_submit() callsite in filemap.c will not be able to inline this
> function because its definition is unavailable at compilation time.
> 
> ra_submit() should be made static inline and moved into a header file
> which all callers include.  Probably in mm.h's /* readahead */ section.

Unfortunately, this means __do_page_cache_readahead needs being referenced there which gives the same conclusion : remove its static prefix or I am missing something ?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-21 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-20 21:53 [PATCH 1/1] mm/filemap.c: ra_submit inline Fabian Frederick
2014-03-20 21:58 ` Andrew Morton
2014-03-21 16:20   ` Fabian Frederick

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.