Large Blocksize Support V3
Subsystems (11)
Quoted 3 lines · David Chinner
Quoted 3 lines
Right - so how do we efficiently manipulate data inside a large block that spans multiple discontigous pages if we don't vmap it?
Quoted 5 lines · Eric W. Biederman
You don't manipulate data except for
copy_from_user,copy_to_user. That is easy comparatively to deal with, and certainly doesn't need vmap.
Meta-data may be trickier, but a lot of that depends on your individual filesystem and how it organizes it's meta-data.
I wonder what happened to my pagearray patches.
-- wli
Quoted 4 lines · David Chinner
Both. To many things can happen asynchroonously to a page that it makes it just about impossible to predict all the potential race conditions that are involved. complexity arose from trying to fix the races that were uncovered without breaking everything else...
Ok.
Quoted 7 lines
Quoted 2 lines
Until we code review and implementation that does page aggregation for linux we can't say how nasty it would be.
We already have an implementation - I've pointed it out several times
now: see fs/xfs/linux-2.6/xfs_buf.[ch].There are a lot of nasties in there....
Yes, and but it isn't a generic implementation in mm/filemap.c, it is a compatibility layer. It lives with the current deficiencies instead of removes them.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line
You're addressing Christoph's straw man here.
No, I'm speaking from years of experience working on a page/buffer/chunk cache capable of using both large pages and aggregating multiple pages. It has, at times, almost driven me insane and I don't want to go back there.
Quoted 8 lines
Quoted 6 lines
The suggestion seems to be to always aggregate pages (to handle
PAGE_SIZE< block size), and not to even worry about the fact that it happens that the pages you are aggregating are physically contiguous. The memory allocator and the block layer can worry about that. It isn't something the page cache or filesystems need to pay attention to.perfomrance problems in using discontigous pages
Small scatter lists?
Quoted 1 line
and needing to
vmap()them says otherwise....
Always?
Ugh. I just realized looking at the xfs code that it doesn't work in the presence of high memory, at least not with 4K pages.
Quoted 7 lines
Quoted 4 lines
I suspect the implementation in linux would be sufficiently different that it would not be prone to the same problems. Among other things we are already do most things on a range of page addresses, so we would seem to have most of the infrastructure already.
Filesystems don't typically do this - they work on blocks and assume that a block can be directly referenced.
But that is how mm/filemap.c works. The calls into the filesystem can be per multi-page group as they are current per page. The point is that the existing in kernel abstraction is already larger then a page for doing the work.
Quoted 13 lines
Quoted 6 lines
Given that small block sizes give us better storage efficiency, which means less disk bandwidth used, which means less time to get the data off of a slow disk (especially if you can put multiple files you want simultaneously in that same space). I'm not convinced that large block sizes are a clear disk performance advantage, so we should not neglect the small file sizes.
Hmmm - we're not talking about using 64k block size filesystems to store lots of little files or using them on small, slow disks. We're looking at optimising for multi-petabyte filesystems with multi-terabyte sized files sustaining throughput of tens to hundreds of GB/s to/from hundreds to thousands of disk.
Quoted 4 lines
I certinaly don't consider 64k block size filesystems as something suitable for desktop use - maybe PVRs would benefit, but this is not something you'd use for your kernel build environment on a single disk in a desktop system....
Yes. You are talking about only fixing the kernel for your giant 64K block filesystems that are only interesting on peta-byte arrays.
I am pointing out that the other fixes that have been discussed. Optimistic contiguous page allocation and a larger linux scatter gather list. Are interesting on much smaller filesystem and machine sizes where small files are still interesting. Making them generally better improvements for linux.
If you only improve the giant peta-byte raid cases 99% of linux users simply don't care, and so the code isn't very interesting.
Eric
Quoted 3 lines · David Chinner
Quoted 3 lines
Quoted 3 lines
Right - so how do we efficiently manipulate data inside a large block that spans multiple discontigous pages if we don't vmap it?
Quoted 5 lines · Eric W. Biederman
Quoted 5 lines
You don't manipulate data except for
copy_from_user,copy_to_user. That is easy comparatively to deal with, and certainly doesn't need vmap.
Meta-data may be trickier, but a lot of that depends on your individual filesystem and how it organizes it's meta-data.
Quoted 1 line · William Lee Irwin III
I wonder what happened to my pagearray patches.
I never really got the thing working, but I had an idea for a sort of library to do this. This is/was probably against something like 2.6.5 but I honestly have no idea. Maybe this makes it something of an API proposal.
-- wli
include/linux/pagearray.h +24 -0
@@ -0,0 +1,24 @@ +#ifndef _LINUX_PAGEARRAY_H +#define _LINUX_PAGEARRAY_H + +struct scatterlist ; +struct vm_area_struct ; +struct page ; + +struct pagearray { +struct page **pages; +int nr_pages; +size_t length; +}; + +int alloc_page_array (struct pagearray *,const int ,const size_t ); +void free_page_array (struct pagearray *); +void zero_page_array (struct pagearray *); +struct page *nopage_page_array (const struct vm_area_struct *,unsigned long ,unsigned long ,int *,struct pagearray *); +int mmap_page_array (const struct vm_area_struct *,struct pagearray *,const size_t ,const size_t ); +int copy_page_array_to_user (struct pagearray *,void __user *,const size_t ,const size_t ); +int copy_page_array_from_user (struct pagearray *,void __user *,const size_t ,const size_t ); +struct scatterlist *pagearray_to_scatterlist (struct pagearray *,size_t ,size_t ,int *); +void *vmap_pagearray (struct pagearray *); + +#endif /* _LINUX_PAGEARRAY_H */
mm/Makefile +1 -1
@@ -10,7 +10,7 @@ obj-y := bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \ page_alloc.o page-writeback.o pdflush.o \ readahead.o slab.o swap.o truncate.o vmscan.o \ - prio_tree.o $(mmu-y) + prio_tree.o pagearray.o $(mmu-y) obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o thrash.o obj-$(CONFIG_HUGETLBFS) += hugetlb.o
mm/pagearray.c +293 -0
293 lines not on this page · raw message
Quoted 4 lines · Eric W. Biederman
Yes, instead of having to redesign the interface between the fs and the page cache for those filesystems that handle large blocks we instead need to redesign significant parts of the VM interface. Shift the redesign work to another group of people and call it a trivial.
To some extend that is true. But then there will then also be additional
gain: We can likely get the VM to handle larger pages too which may get rid of hugetlb fs etc. The work is pretty straightforward: No locking changes f.e. So hardly a redesign. I think the crucial point is the antifrag/defrag issue if we want to generalize it.
I have an updated patch here that relies on page reservations. Adds something called page pools. On bootup you need to specify how many pages of each size you want. The page cache will then use those pages for filesystems that need larger blocksize.
The interesting thing about that one is that it actually enables support foir multiple blocksizes with a single larger pagesize. If f.e. we setup a pool of 64k pages then the block layer can segment that into 16k pieces. So one can actually use 16k 32k and 64k block size with a single larger page size.
Quoted 4 lines · Eric W. Biederman
Quoted 4 lines
Yes, instead of having to redesign the interface between the fs and the page cache for those filesystems that handle large blocks we instead need to redesign significant parts of the VM interface. Shift the redesign work to another group of people and call it a trivial.
Quoted 5 lines · Christoph Lameter
To some extend that is true. But then there will then also be additional
gain: We can likely get the VM to handle larger pages too which may get rid of hugetlb fs etc. The work is pretty straightforward: No locking changes f.e. So hardly a redesign. I think the crucial point is the antifrag/defrag issue if we want to generalize it.
Sadly, a backward compatibility stub must be retained in perpetuity. It should be able to be reduced to the point it doesn't need its own dedicated source files or config options, but it'll need something to deal with the arch code.
-- wli
include/linux/pagearray.h line 22
Quoted 9 lines · William Lee Irwin III
include/linux/pagearray.h +9
-0+int alloc_page_array (struct pagearray *,const int ,const size_t ); +void free_page_array (struct pagearray *); +void zero_page_array (struct pagearray *); +struct page *nopage_page_array (const struct vm_area_struct *,unsigned long ,unsigned long ,int *,struct pagearray *); +int mmap_page_array (const struct vm_area_struct *,struct pagearray *,const size_t ,const size_t ); +int copy_page_array_to_user (struct pagearray *,void __user *,const size_t ,const size_t ); +int copy_page_array_from_user (struct pagearray *,void __user *,const size_t ,const size_t ); +struct scatterlist *pagearray_to_scatterlist (struct pagearray *,size_t ,size_t ,int *); +void *vmap_pagearray (struct pagearray *);
This should probably have memcpy to/from pagearrays. Whole-hog read and write f_op implementations would be good, too, since ISTR some drivers basically do little besides that on their internal buffers.
vmap_pagearray() should take flags, esp. VM_IOREMAP but perhaps also protections besides PAGE_KERNEL in case uncachedness is desirable. I'm not entirely sure what it'd be used for if discontiguity is so heavily supported. My wild guess is drivers that do things that are just too weird to support with the discontig API, since that's how I used it. It should support vmap()'ing interior sub-ranges, too.
The pagearray mmap() support is schizophrenic as to whether it prefills or faults and not all that complete as far as manipulating the mmap() goes. Shooting down ptes, flipping pages, or whatever drivers actually do with the things should have helpers arranged. Coherent sets of helpers for faulting vs. mmap()'ing idioms would be good.
pagearray_to_scatterlist() should probably take the scatterist as an argument instead of allocating the scatterlist itself.
Something to construct bio's from pagearrays might help.
s/page_array/pagearray/g should probably be done. Prefixing with pagearray_ instead of randomly positioning it within the name would be good, too.
Some working API conversions on drivers sound like a good idea. I had some large number of API conversions about, now lost, but they'd be bitrotted anyway.
struct pagearray is better off as an opaque type so large pagearray handling can be added in later via radix trees or some such, likewise for expansion and contraction. Keeping drivers' hands off the internals is just a good idea in general.
I'm somewhat less clear on what filesystems need to do here, or if it would be useful for them to efficiently manipulate data inside a large block that spans multiple discontiguous pages. I expect some changes are needed at the very least to fill a pagearray with whatever predetermined pages are needed. Filesystems probably need other changes to handle sparse pagearrays and refilling pages within them via IO.
-- wli
Just to stick my two cents in here:
The definition of what is meant by "large" filesystems has to change with the advances in disk drive technology. In the not too distant past, a "large" single filesystem was 100 GB. There are now consumer grade disks on the market with 1 TB available in a single unit. I don't know about you guys, but that scares the crap out of me, in terms of dealing with that much space on a desktop machine. Efficiently dealing with transferring that much data on a desktop (never mind server) means re-thinking the limitations of the I/O subsystems. What was once the realm of the data center is now the realm of the living room. Large data sets are becoming more commonplace (HD Movies, audio files, etc) with each passing day, and there is no end in sight in the progression. In addition, with the release of specs recently about larger sector sizes for disk drives (2048 bytes, or larger), this is going to become a pressing need for the general case, not just the extremely large servers, or HPC machines and clusters. Already there is no efficient way to back up that much space, in a reasonable time, except to have another disk of a similar or larger size to back up to. Anything we can do to make disk I/O *Faster* is a win.
I recognize that there is a huge issue in dealing with sub block size files. The trade off of small files VS large blocks is now a non trivial problem. Once disk sector sizes increase, the problems will have to be dealt with in a more intelligent manner, possibly dividing sectors into smaller logical blocks for small files? Maybe filesystems that can understand multiple block sizes?
Well, we do live in interesting times; we just have to make the most of it.
Dan Weigert
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Eric W. Biederman
Sent: Monday, May 07, 2007 2:56 AM
To: David Chinner
Cc: Andrew Morton; [email protected]; [email protected]; Mel Gorman; William Lee Irwin III; Jens Axboe; Badari Pulavarty; Maxim Levitsky
Subject: Re: [00/17] Large Blocksize Support V3
Quoted 4 lines · David Chinner
Both. To many things can happen asynchroonously to a page that it makes it just about impossible to predict all the potential race conditions that are involved. complexity arose from trying to fix the races that were uncovered without breaking everything else...
Ok.
Quoted 1 line
Quoted 1 line
Until we code review and implementation that does page aggregation
for
Quoted 6 lines
Quoted 1 line
linux we can't say how nasty it would be.
We already have an implementation - I've pointed it out several times
now: see fs/xfs/linux-2.6/xfs_buf.[ch].There are a lot of nasties in there....
Yes, and but it isn't a generic implementation in mm/filemap.c, it is a compatibility layer. It lives with the current deficiencies instead of removes them.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line
You're addressing Christoph's straw man here.
No, I'm speaking from years of experience working on a page/buffer/chunk cache capable of using both large pages and aggregating multiple pages. It has, at times, almost driven me insane and I don't want to go back there.
Quoted 8 lines
Quoted 6 lines
The suggestion seems to be to always aggregate pages (to handle
PAGE_SIZE< block size), and not to even worry about the fact that it happens that the pages you are aggregating are physically contiguous. The memory allocator and the block layer can worry about that. It isn't something the page cache or filesystems need to pay attention to.perfomrance problems in using discontigous pages
Small scatter lists?
Quoted 1 line
and needing to
vmap()them says otherwise....
Always?
Ugh. I just realized looking at the xfs code that it doesn't work in the presence of high memory, at least not with 4K pages.
Quoted 7 lines
Quoted 4 lines
I suspect the implementation in linux would be sufficiently different that it would not be prone to the same problems. Among other things we are already do most things on a range of page addresses, so we would seem to have most of the infrastructure already.
Filesystems don't typically do this - they work on blocks and assume that a block can be directly referenced.
But that is how mm/filemap.c works. The calls into the filesystem can be per multi-page group as they are current per page. The point is that the existing in kernel abstraction is already larger then a page for doing the work.
Quoted 13 lines
Quoted 6 lines
Given that small block sizes give us better storage efficiency, which means less disk bandwidth used, which means less time to get the data off of a slow disk (especially if you can put multiple files you want simultaneously in that same space). I'm not convinced that large block sizes are a clear disk performance advantage, so we should not neglect the small file sizes.
Hmmm - we're not talking about using 64k block size filesystems to store lots of little files or using them on small, slow disks. We're looking at optimising for multi-petabyte filesystems with multi-terabyte sized files sustaining throughput of tens to hundreds of GB/s to/from hundreds to thousands of disk.
Quoted 4 lines
I certinaly don't consider 64k block size filesystems as something suitable for desktop use - maybe PVRs would benefit, but this is not something you'd use for your kernel build environment on a single disk in a desktop system....
Yes. You are talking about only fixing the kernel for your giant 64K block filesystems that are only interesting on peta-byte arrays.
I am pointing out that the other fixes that have been discussed. Optimistic contiguous page allocation and a larger linux scatter gather list. Are interesting on much smaller filesystem and machine sizes where small files are still interesting. Making them generally better improvements for linux.
If you only improve the giant peta-byte raid cases 99% of linux users simply don't care, and so the code isn't very interesting.
Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-----------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.