Re: [PATCH] xfs: use a dedicated SLAB cache for sector sized buffer data

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

 



On Wed, Dec 05, 2018 at 09:20:23AM -0800, Christoph Hellwig wrote:
> XFS currently uses a slab allocator for buffers smaller than the page

Currently uses heap allocated memory?

> size to avoid wasting too much memory.  But this can cause a problem
> with slub debugging turned on as the allocations might not be naturally
> aligned.  On block devices that require sector size alignment this can
> lead to data corruption.
> 
> Give that our smaller than page size buffers are always sector sized
> on a live file system, we can just create a kmem_cache with an
> explicitly specified alignment requirement for this case to fix this
> case without much effort.

I thought you were looking at using the page_frag infrastructure for
this so we didn't need a slab per filesystem for this?

I think there's a problem with this code - we can have different
sector sizes for different devices in the filesystem. e.g. the log
can have a different sector size to the data device, and this may
matter for log recovery which does a lot of single sector IO.

Hence I think this slab really needs to be managed as a property of
the of the buftarg rather than be a global property of the
xfs_mount. in most cases the log and data devices are the same
buftarg, but we should attempt to handle this special case
correctly...

Other than that, the code looks fine to me.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux