Re: question regarding caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3 January 2014 13:12, Austin S Hemmelgarn <ahferroin7@xxxxxxxxx> wrote:
>
> On 2014-01-03 03:39, Sander wrote:
> > Austin S Hemmelgarn wrote (ao):
> >> The data is probably still cached in the block layer, so after
> >> unmounting, you could try 'echo 1 > /proc/sys/vm/drop_caches'
> >> before mounting again, but make sure to run sync right before
> >> doing that, otherwise you might lose data.
> >
> > Lose data? Where you get this from?
> >
> > Sander
> >
> Sorry, misread the documentation, thought it said destructive where it
> really said non-destructive.
> It's still a good idea to run sync before trying to clear the caches
> though, cause dirty objects aren't freeable.

Hello,

I figured out what the problem was. After remounting, I was doing
fseek to the end of file to calculate the file size. It seems that
fseek does prefetching of file data, which is why my reads were being
served from the cache rather than from the disk. I could not find
where this prefetching is called from. Anyways, using fstat instead of
fseek to find the file size ensures that there is no unwanted
prefetching.

Thanks,
Aastha.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux