linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 105121] lseek(SEEK_DATA) hangs for a long time for sparse files in the page cache
Date: Mon, 28 Sep 2015 14:47:15 +0000	[thread overview]
Message-ID: <bug-105121-13602-N20Orx3usd@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-105121-13602@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=105121

--- Comment #1 from Theodore Tso <tytso@mit.edu> ---
Thanks for reporting this!

What's going on is that the "cat test > /dev/null" is instantiating 1GB of zero
pages in the page cache.

Currently, we are using the extent status to determine if a logical block is
mapped to a physical block.  However, the SEEK_DATA code dates back from a time
when we were not storing the status of delayed allocation blocks in the extent
status cache.  So if the extent status cache indicates that the blocks are
unwritten, the code which is handling fseek(SEEK_DATA) is scanning all of the
pages to determine if any of the unwritten blocks happen to be modified in
memory, but which haven't been pushed out to disk yet.

We should be able to optimize this (and simplify the code as a bonus) by using
the EXTENT_STATUS_DELAYED flag instead of trying to scan through all of the
page structs (with all of the locking requirements this entails).

Out of curiosity, what was the use case that caused you to notice this?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2015-09-28 14:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 12:27 [Bug 105121] New: lseek() hangs for a long time on allocated files bugzilla-daemon
2015-09-28 14:37 ` [Bug 105121] lseek(SEEK_DATA) hangs for a long time for sparse files in the page cache bugzilla-daemon
2015-09-28 14:47 ` bugzilla-daemon [this message]
2015-09-28 14:52 ` bugzilla-daemon
2015-09-28 15:15 ` bugzilla-daemon
2015-09-28 15:23 ` bugzilla-daemon
2019-01-18  7:44 ` bugzilla-daemon

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-105121-13602-N20Orx3usd@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-ext4@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).