RE: [PATCH RFC] introduce ioctl to completely invalidate page cache

2014-10-06 Thread Thanos Makatos
Thanks, Jan, it's much clearer now what I need to do. > So most notably they want the ioctl to work not only for block devices but > also for any regular file. That's easily doable - you just call > filemap_write_and_wait() and invalidate_inode_pages2() in the ioctl handler > for regular files

RE: [PATCH RFC] introduce ioctl to completely invalidate page cache

2014-10-06 Thread Thanos Makatos
> > Trond also had a comment that if we extended the ioctl to work for all > > inodes (not just blkdev) and allowed some additional flags of what > > needs to be invalidated, the new ioctl would be also useful to NFS > > userspace - see Trond's email at > > > > http://www.spinics.net/lists/linux-fs

RE: [PATCH RFC] introduce ioctl to completely invalidate page cache

2014-10-06 Thread Thanos Makatos
> > We're currently ignoring the buffer cache sync and invalidation (which > > is odd), but at least being consistent would be good. > Well, invalidate_bdev() doesn't return anything. And > invalidate_mapping_pages() inside invalidate_bdev() returns only number of > invalidated pages. I don't thi

RE: [PATCH RFC] introduce ioctl to completely invalidate page cache

2014-10-03 Thread Thanos Makatos
> > - fsync_bdev(bdev); > > - invalidate_bdev(bdev); > > + flush_buffer_cache(bdev); > > + if (BLKFLSBUF2 == cmd) > > + return invalidate_inode_pages2( > > + bdev->bd_inode->i_mapping); > > retur

RE: [PATCH RFC] introduce ioctl to completely invalidate page cache

2014-10-03 Thread Thanos Makatos
> > > This patch introduces a new ioctl called BLKFLUSHBUFS2, which is > > > pretty > > What a horrible name. Whatever happened to naming ioctls interfaces after > their function? i.e. BLKFLUSHINVAL? Indeed it's not a good name, I'm open to suggestions! -- To unsubscribe from this list: send the

Full buffer cache not working properly

2007-07-12 Thread Thanos Makatos
I run several times the following test and what I've seen is that when the buffer cache becomes full, unneeded dirty buffer heads are not evicted and no other memory allocation can happen (including reading a block from the disk to the buffer cache). Should this happen? Here's the code that repr

Full buffer cache not working as expected

2007-07-12 Thread Thanos Makatos
I run several times the following test and what I've seen is that when the buffer cache becomes full, unneeded dirty buffer heads are not evicted and no other memory allocation can happen (including reading a block from the disk to the buffer cache). Should this happen? Here's the code that reprod

Error using the buffer cache

2007-05-03 Thread Thanos Makatos
I've written a module that acts as a cache for fixed size objects but I get a soft lockup trying to use the buffer cache. I've attached the module that reproduces the error. You need to supply the module with a block device, i.e. insmod disk_cache.ko devname="/dev/hda2". /* * An object oriented d