public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: jbarnes@engr.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: remove dentry_open::file_ra_init_state() duplicated memset was Re: kernbench on 512p
Date: Thu, 19 Aug 2004 23:21:45 -0700	[thread overview]
Message-ID: <20040819232145.2fd5c54a.akpm@osdl.org> (raw)
In-Reply-To: <20040820005654.GC6374@logos.cnet>

Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
>
> So this patch creates a __file_ra_state_init() function, which initializes
>  the file_ra_state fields, without the memset. 
> 
>  file_ra_state_init() does the memset + its __ counterpart. 

Seems unnecessarily fiddly.  How about this?

--- 25/mm/readahead.c~file_ra_state_init-speedup	2004-08-19 23:20:11.695876032 -0700
+++ 25-akpm/mm/readahead.c	2004-08-19 23:20:42.077257360 -0700
@@ -28,12 +28,12 @@ struct backing_dev_info default_backing_
 EXPORT_SYMBOL_GPL(default_backing_dev_info);
 
 /*
- * Initialise a struct file's readahead state
+ * Initialise a struct file's readahead state.  Assumes that the caller has
+ * memset *ra to zero.
  */
 void
 file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
 {
-	memset(ra, 0, sizeof(*ra));
 	ra->ra_pages = mapping->backing_dev_info->ra_pages;
 	ra->average = ra->ra_pages / 2;
 }
diff -puN fs/nfsd/vfs.c~file_ra_state_init-speedup fs/nfsd/vfs.c
--- 25/fs/nfsd/vfs.c~file_ra_state_init-speedup	2004-08-19 23:20:11.713873296 -0700
+++ 25-akpm/fs/nfsd/vfs.c	2004-08-19 23:21:05.721662864 -0700
@@ -771,6 +771,7 @@ nfsd_get_raparms(dev_t dev, ino_t ino, s
 	ra = *frap;
 	ra->p_dev = dev;
 	ra->p_ino = ino;
+	memset(&ra->p_ra, 0, sizeof(ra->p_ra));
 	file_ra_state_init(&ra->p_ra, mapping);
 found:
 	if (rap != &raparm_cache) {
_


  reply	other threads:[~2004-08-20  6:23 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-19 16:16 kernbench on 512p Jesse Barnes
2004-08-19 16:22 ` William Lee Irwin III
2004-08-19 16:29 ` David Mosberger
2004-08-19 16:37   ` Jesse Barnes
2004-08-19 16:40     ` David Mosberger
2004-08-19 17:55       ` Alan Cox
2004-08-20  7:53         ` David Mosberger
2004-08-19 18:25     ` Martin J. Bligh
2004-08-19 18:42       ` Jesse Barnes
2004-08-19 21:11       ` Jesse Barnes
2004-08-19 21:24         ` Jesse Barnes
2004-08-19 21:56           ` Martin J. Bligh
2004-08-20 19:36             ` Maneesh Soni
2004-08-19 23:38           ` Paul E. McKenney
2004-08-20  0:16             ` Jesse Barnes
2004-08-20 15:57               ` Paul E. McKenney
2004-08-20 17:24                 ` Jesse Barnes
2004-08-20 19:22                   ` Manfred Spraul
2004-08-20 20:19                   ` Manfred Spraul
2004-08-23 21:23                     ` Jesse Barnes
2004-08-23 23:13                       ` Jesse Barnes
2004-09-10 19:01                     ` Greg Edwards
2004-09-13 18:21                       ` Manfred Spraul
2004-09-14 17:52                         ` Greg Edwards
2004-09-14 18:16                           ` Manfred Spraul
2004-09-14 18:43                             ` Greg Edwards
2004-09-14 19:16                               ` Manfred Spraul
2004-08-19 21:50         ` Ray Bryant
2004-08-19 22:00           ` Jesse Barnes
2004-08-19 23:03 ` William Lee Irwin III
2004-08-20 17:35   ` William Lee Irwin III
2004-08-20  0:56 ` remove dentry_open::file_ra_init_state() duplicated memset was " Marcelo Tosatti
2004-08-20  6:21   ` Andrew Morton [this message]
2004-08-20  7:28     ` Marcelo Tosatti
2004-08-20  8:34       ` Andrew Morton

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=20040819232145.2fd5c54a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jbarnes@engr.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.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