From: NeilBrown <neilb@suse.de>
To: "Yucong Sun (叶雨飞)" <sunyucong@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Raid10 and page cache
Date: Wed, 7 Dec 2011 09:26:25 +1100 [thread overview]
Message-ID: <20111207092625.7140c5dc@notabene.brown> (raw)
In-Reply-To: <CAJygYd3ofkHp9huD_Q1xoKVb_Q2LTDAnFHf-n+8xyG7ug3wC_Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2190 bytes --]
On Tue, 6 Dec 2011 14:01:14 -0800 Yucong Sun (叶雨飞) <sunyucong@gmail.com>
wrote:
> Hi,
>
> I recently setup raid10 on 4 physical disk and have a iscsi serve it
> as a block device, and have been trying to tweak for performance.
>
> First thing I notice that MD seems to rely on page cache to flush
> changes to disk, is there any way to turn that off so changes are
> flushed to the disk? like O_FSYNC|O_DIRECT does? The reason I want to
> turn it off is to understand the performance difference, I want to be
> sure that page cache is truly acting as a write-back cache, I know one
> can tune the dirty_* to control the cache flush, but I want to make
> sure that it is actually doing what I think it does.
Why do you think this?
md/raid10 sends all request straight through to the relevant underlying
device(s).
reads are just passed straight down.
Writes are duplicated (the request structure, not the data) and queued to a
separate thread which does the actual write, but it is fairly direct.
>
> Then I notice in output of free, the number in Cache column is very
> low, however the Buffer is very high, my question is does Buffer here
> serves as a read cache? I couldn't find the answer anywhere else.
The best place to find the answer is in the source code.
Every page in the page cache is associated with some file.
If that file is a block device (e.g. /dev/sdX) then it is reported as
'Buffer' otherwise it is reported as 'Cache'.
Some filesystems like ext3 uses 'Buffer' memory for metadata but call use
'Cache' memory for files and directories.
>
> My last question is that since MD seems already doing the cache, what
> effect would it have if I want to setup a LO device in front of MD
> device, Is there going to be more caching, how is different than just
> plain MD device?
MD/raid10 does no caching.
A loop-back over the md device would not add extra caching.
NeilBrown
>
> Thanks.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2011-12-06 22:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-06 21:29 Raid10 and page cache Yucong Sun (叶雨飞)
2011-12-06 22:01 ` Yucong Sun (叶雨飞)
2011-12-06 22:26 ` NeilBrown [this message]
2011-12-06 23:13 ` Yucong Sun (叶雨飞)
2011-12-06 23:22 ` Marcus Sorensen
2011-12-07 1:01 ` NeilBrown
2011-12-07 4:04 ` Yucong Sun (叶雨飞)
2011-12-07 4:28 ` NeilBrown
2011-12-07 4:50 ` Yucong Sun (叶雨飞)
2011-12-07 5:10 ` NeilBrown
2011-12-07 6:14 ` Yucong Sun (叶雨飞)
2011-12-07 9:21 ` Yucong Sun (叶雨飞)
2011-12-07 23:37 ` Yucong Sun (叶雨飞)
2011-12-08 0:10 ` NeilBrown
2011-12-08 6:31 ` Yucong Sun (叶雨飞)
[not found] ` <CAJygYd16PWfKe8fK-b150N46CEwzBUqJn1N6dfsGR4yyTgGbTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-06 22:01 ` Yucong Sun (叶雨飞)
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=20111207092625.7140c5dc@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=sunyucong@gmail.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 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.