public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "green at linuxhacker dot ru" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug stdio/4099] Overly agressive caching by stream i/o functions.
Date: Mon, 27 May 2013 01:09:00 -0000	[thread overview]
Message-ID: <bug-4099-131-Jx5WAeFl53@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-4099-131@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=4099

--- Comment #8 from Oleg Drokin <green at linuxhacker dot ru> ---
(In reply to Rich Felker from comment #7)

> This only makes sense if write() actually writes something to disk. It
> doesn't. It (conceptually) memcpy's from a userspace buffer to the kernel's
> cache buffers. So there's no reason to think the optimal write() size has
> anything to do with the filesystem's block size.

Even if there is no immediate write, there might be other considerations:
networking filesytems (like Lustre) might need to do extra locking gymnastics
per every syscall (overall syscalls are somewhat expensive, we already touched
on that), if there are conflicting accesses to the file that force lock
revocations, doing writes in large chunks means that cache writeout happens in
larger chunks which helps RPC sizes and disk backend loads.

"Legacy" filesystems that don't have delayed block allocation might use write
size as a gauge of how big of a block of free space to find on disk so that the
file is less fragmented (and to reduce block allocator overhead and metadata
updates overhead) - we certainly did this back in reiserfs days.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  parent reply	other threads:[~2013-05-27  1:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-4099-131@http.sourceware.org/bugzilla/>
2012-02-21  1:35 ` jsm28 at gcc dot gnu.org
2012-12-19 10:40 ` schwab@linux-m68k.org
2013-05-20 19:49 ` ondra at iuuk dot mff.cuni.cz
2013-05-25 12:55 ` bugdal at aerifal dot cx
2013-05-25 19:20 ` neleai at seznam dot cz
2013-05-25 19:54 ` bugdal at aerifal dot cx
2013-05-26 11:53 ` neleai at seznam dot cz
2013-05-26 16:31 ` green at linuxhacker dot ru
2013-05-26 17:40 ` bugdal at aerifal dot cx
2013-05-27  1:09 ` green at linuxhacker dot ru [this message]
2014-11-28 16:15 ` carlos at redhat dot com
2020-11-02  7:56 ` [Bug stdio/4099] Overly aggressive " ldv at sourceware dot org

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=bug-4099-131-Jx5WAeFl53@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).