ext4: Use slab allocator for sub-page sized allocations
Now that the SLUB seems to be fixed so that it respects the requested alignment, use kmem_cache_alloc() to allocator if the block size of the buffer heads to be allocated is less than the page size. Previously, we were using 16k page on a Power system for each buffer, even when the file system was using 1k or 4k block size. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
@@ -69,15 +69,8 @@ extern u8 jbd2_journal_enable_debug;
|
||||
#define jbd_debug(f, a...) /**/
|
||||
#endif
|
||||
|
||||
static inline void *jbd2_alloc(size_t size, gfp_t flags)
|
||||
{
|
||||
return (void *)__get_free_pages(flags, get_order(size));
|
||||
}
|
||||
|
||||
static inline void jbd2_free(void *ptr, size_t size)
|
||||
{
|
||||
free_pages((unsigned long)ptr, get_order(size));
|
||||
};
|
||||
extern void *jbd2_alloc(size_t size, gfp_t flags);
|
||||
extern void jbd2_free(void *ptr, size_t size);
|
||||
|
||||
#define JBD2_MIN_JOURNAL_BLOCKS 1024
|
||||
|
||||
|
Reference in New Issue
Block a user