From: Andi Kleen <andi@firstfloor.org>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, dehrenberg@google.com,
Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 3/6] DIO: Rearrange fields in dio/dio_submit to avoid holes.
Date: Wed, 22 Jun 2011 12:18:39 -0700 [thread overview]
Message-ID: <1308770322-22565-4-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1308770322-22565-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
Fix most problems reported by pahole.
There is still a weird 104 byte hole after map_bh. I'm not sure what
causes this.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
fs/direct-io.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 823d2fe..03deca3 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -73,10 +73,10 @@ struct dio_submit {
sector_t block_in_file; /* Current offset into the underlying
file in dio_block units. */
unsigned blocks_available; /* At block_in_file. changes */
+ int reap_counter; /* rate limit reaping */
sector_t final_block_in_request;/* doesn't change */
unsigned first_block_in_page; /* doesn't change, Used only once */
int boundary; /* prev block is at a boundary */
- int reap_counter; /* rate limit reaping */
get_block_t *get_block; /* block mapping function */
dio_submit_t *submit_io; /* IO submition function */
@@ -114,27 +114,26 @@ struct dio_submit {
/* dio_state communicated between submission path and end_io */
struct dio {
int flags; /* doesn't change */
- struct inode *inode;
int rw;
+ struct inode *inode;
loff_t i_size; /* i_size when submitted */
dio_iodone_t *end_io; /* IO completion function */
- struct buffer_head map_bh; /* last get_block() result */
/* BIO completion state */
spinlock_t bio_lock; /* protects BIO fields below */
+ int page_errors; /* errno from get_user_pages() */
+ int is_async; /* is IO async ? */
+ int io_error; /* IO error in completion path */
unsigned long refcount; /* direct_io_worker() and bios */
struct bio *bio_list; /* singly linked via bi_private */
struct task_struct *waiter; /* waiting task (NULL if none) */
/* AIO related stuff */
struct kiocb *iocb; /* kiocb */
- int is_async; /* is IO async ? */
- int io_error; /* IO error in completion path */
ssize_t result; /* IO result */
- int page_errors; /* errno from get_user_pages() */
-
+ struct buffer_head map_bh; /* last get_block() result */
/*
* pages[] (and any fields placed after it) are not zeroed out at
* allocation time. Don't add new fields after pages[] unless you
--
1.7.4.4
next prev parent reply other threads:[~2011-06-22 19:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 19:18 RFC: Micro-optimize direct IO submission path Andi Kleen
2011-06-22 19:18 ` [PATCH 1/6] DIO: Separate fields only used in the submission path from struct dio Andi Kleen
2011-06-22 19:18 ` [PATCH 2/6] DIO: Fix a wrong comment Andi Kleen
2011-06-22 19:18 ` Andi Kleen [this message]
2011-06-22 19:18 ` [PATCH 4/6] DIO: Use a slab cache for struct dio Andi Kleen
2011-06-22 19:18 ` [PATCH 5/6] DIO: Separate map_bh from dio Andi Kleen
2011-06-22 19:59 ` Christoph Hellwig
2011-06-22 19:18 ` [PATCH 6/6] DIO: Inline the complete submission path Andi Kleen
2011-06-22 19:59 ` Christoph Hellwig
2011-06-22 20:10 ` Andi Kleen
2011-06-23 10:35 ` Christoph Hellwig
2011-07-27 21:06 ` RFC: Micro-optimize direct IO " Christoph Hellwig
2011-07-27 21:35 ` Andi Kleen
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=1308770322-22565-4-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=dehrenberg@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).