On Thu, Dec 06, 2018 at 04:17:15PM +0100, Christoph Hellwig wrote: > On Thu, Dec 06, 2018 at 07:51:52AM -0500, Brian Foster wrote: > > On Wed, Dec 05, 2018 at 02:51:47PM -0800, Christoph Hellwig wrote: > > > XFS currently uses kmalloc for buffers smaller than the page 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. > > > > > > > What exactly is the data corruption related problem? Can you > > characterize it in a couple sentences? > > Ming reported the actual occurance, so he can explain in detail. But > the summary is that various devices require a minimum alignment for DMA, > and if we don't follow that bad things will happen. What "bad things" > are might vary from case to case. I think it's worth mentioning in the comment that we're doing aligned slab cache thing to avoid screwing up certain devices' DMA requirements for IO requests, even if we leave out the particulars of what 'bad things' means. --D