Re: Linux 2.6.29



Linus Torvalds wrote:

On Thu, 2 Apr 2009, Linus Torvalds wrote:
On Thu, 2 Apr 2009, Andrew Morton wrote:
A suitable design for the streaming might be, every 4MB:

- run sync_file_range(SYNC_FILE_RANGE_WRITE) to get the 4MB underway
to the disk

- run fadvise(POSIX_FADV_DONTNEED) against the previous 4MB to
discard it from pagecache.
Here's an example. I call it "overwrite.c" for obvious reasons.

Oh, except my example doesn't do the fadvise. Instead, I make sure to throttle the writes and the old range with

SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER

which makes sure that the old pages are easily dropped by the VM - and they will be, since they end up always being on the cold list.

I _wanted_ to add a SYNC_FILE_RANGE_DROP but I never bothered because this particular load it didn't matter. The system was perfectly usable while overwriting even huge disks because there was never more than 8MB of dirty data in flight in the IO queues at any time.
..

Note that for mythtv, this may not be the best behaviour.

A common use scenario is "watching live TV", a few minutes behind
real-time so that the commercial-skipping can work its magic.

In that scenario, those pages are going to be needed again
within a short while, and it might be useful to keep them around.

But then Myth itself could probably decide whether to discard them
or not, not based upon that kind of knowledge.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Why arent partitions limited to fit within the device?
    ... If I recall correctly at that time the idea was to discard ... partitions that do not fit on the known disk. ... Your idea is better, namely to clip partitions. ... the partition type of the root disk, ...
    (Linux-Kernel)
  • About removable disks, mountroot and sw-raid
    ... Machine boots, all raid disks present. ... Machine boots, one raid disk missing. ... GEOM will similarly hold reference counts until all tasting have ... Scenario B is only solvable with outside knowledge. ...
    (freebsd-arch)
  • Re: Why arent partitions limited to fit within the device?
    ... within the device - and discard those that are completely beyond ... to mainline? ... Any partition which is partly outside the disk should be ... So Alan things a partially-outside-this-disk partition ...
    (Linux-Kernel)
  • Re: "Antispam UOL" spam from petsupermarket@uol.com.br?
    ... > And curently I am forwarding all those SPAM's to there abuse address. ... discard any AntiSPAM UOL emails;-)). ... it is probably best to just discard it. ... "One disk to rule them all, ...
    (Debian-User)
  • dual boot scenario exam sim question
    ... came across a practice question with scenario similar to this: ... one hard drive, basic disk, several volumes, dual booting XP Pro and Server ... converting to dynamic disk and expanding the volume. ... I have known that dynamic disks will break many dual boot scenarios ...
    (microsoft.public.cert.exam.mcsa)