From: Bernd Schubert <bs@q-leap.de>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: linux-kernel@vger.kernel.org,
"J. Bruce Fields" <bfields@fieldses.org>,
brian@clusterfs.com,
Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de>,
bs@q-leap.de
Subject: Re: patch: improve generic_file_buffered_write() (2nd try 2/2)
Date: Wed, 5 Sep 2007 19:49:28 +0200 [thread overview]
Message-ID: <200709051949.28585.bs@q-leap.de> (raw)
In-Reply-To: <200709051941.56145.bs@q-leap.de>
I guess when aio was introduced this was probably forgotten. For small chunks
or synchronous i/o the likehood is correct, but for big data chunks and aio
the likehood is false.
Signed-off-by: Bernd Schubert <bs@q-leap.de>
Signed-off-by: Goswin von Brederlow <goswin@vonbrederlow.de>
Index: linux-2.6.20.3/mm/filemap.c
===================================================================
--- linux-2.6.20.3.orig/mm/filemap.c 2007-09-05 18:51:59.000000000 +0200
+++ linux-2.6.20.3/mm/filemap.c 2007-09-05 18:53:12.000000000 +0200
@@ -2100,7 +2100,7 @@
/*
* handle partial DIO write. Adjust cur_iov if needed.
*/
- if (likely(nr_segs == 1))
+ if (nr_segs == 1)
buf = iov->iov_base + written;
else {
filemap_set_next_iovec(&cur_iov, &iov_base, written);
@@ -2167,7 +2167,7 @@
vmtruncate(inode, isize);
}
}
- if (likely(nr_segs == 1))
+ if (nr_segs == 1)
copied = filemap_copy_from_user(page, offset,
buf, bytes);
else
@@ -2213,7 +2213,7 @@
count -= copied;
pos += copied;
buf += copied;
- if (unlikely(nr_segs > 1)) {
+ if (nr_segs > 1) {
filemap_set_next_iovec(&cur_iov,
&iov_base, copied);
if (count)
next prev parent reply other threads:[~2007-09-05 17:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-05 13:45 patch: improve generic_file_buffered_write() Bernd Schubert
2007-09-05 15:35 ` Randy Dunlap
2007-09-05 17:41 ` patch: improve generic_file_buffered_write() (2nd try 1/2) Bernd Schubert
2007-09-05 17:49 ` Bernd Schubert [this message]
2007-09-08 4:15 ` Nick Piggin
2007-09-07 20:01 ` Goswin von Brederlow
2007-09-08 6:28 ` Nick Piggin
2007-09-07 21:12 ` Goswin von Brederlow
2007-09-08 7:25 ` Nick Piggin
2007-09-08 7:31 ` Nick Piggin
2007-09-08 9:43 ` Goswin von Brederlow
2007-09-07 20:12 ` Nick Piggin
2007-09-07 21:00 ` Goswin von Brederlow
2007-09-08 7:14 ` Nick Piggin
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=200709051949.28585.bs@q-leap.de \
--to=bs@q-leap.de \
--cc=bfields@fieldses.org \
--cc=brederlo@informatik.uni-tuebingen.de \
--cc=brian@clusterfs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.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