From: Vlastimil Babka <vbabka@suse.cz>
To: Matthew Wilcox <willy@infradead.org>,
"Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Ming Lei <ming.lei@redhat.com>, Ming Lei <tom.leiming@gmail.com>,
Dave Chinner <david@fromorbit.com>,
"open list:XFS FILESYSTEM" <linux-xfs@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Dave Chinner <dchinner@redhat.com>,
Christoph Hellwig <hch@lst.de>,
Alexander Duyck <alexander.h.duyck@linux.intel.com>,
Aaron Lu <aaron.lu@intel.com>, Christopher Lameter <cl@linux.com>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
linux-block <linux-block@vger.kernel.org>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc
Date: Wed, 27 Feb 2019 08:07:31 +0100 [thread overview]
Message-ID: <095ae112-f98e-9516-910a-43b49ea5bf0d@suse.cz> (raw)
In-Reply-To: <20190226161912.GG11592@bombadil.infradead.org>
On 2/26/19 5:19 PM, Matthew Wilcox wrote:
> On Tue, Feb 26, 2019 at 08:14:33AM -0800, Darrick J. Wong wrote:
>> On Tue, Feb 26, 2019 at 06:04:40AM -0800, Matthew Wilcox wrote:
>> Wait a minute, are you all saying that /directio/ is broken on XFS too??
>> XFS doesn't use blockdev_direct_IO anymore.
>>
>> I thought we were talking about alignment of XFS metadata buffers
>> (xfs_buf.c), which is a very different topic.
>>
>> As I understand the problem, in non-debug mode the slab caches give
>> xfs_buf chunks of memory that are aligned well enough to work, but in
>> debug mode the slabs allocate slightly more bytes to carry debug
>> information which pushes the returned address up slightly, thus breaking
>> the alignment requirements.
>>
>> So why can't we just move the debug info to the end of the object? If
>> our 512 byte allocation turns into a (512 + a few more) bytes we'll end
>> up using 1024 bytes on the allocation regardless, so it shouldn't matter
>> to put the debug info at offset 512. If the reason is fear that kernel
>> code will scribble off the end of the object, then return (*obj + 512).
>> Maybe you all have already covered this, though?
>
> I don't know _what_ Ming Lei is saying. I thought the problem was
> with slab redzones, which need to be before and after each object,
> but apparently the problem is with KASAN as well.
That's what I thought as well. But if we can solve it for caches created
by kmem_cache_create(..., align, ...) then IMHO we could guarantee
natural alignment for power-of-two kmalloc caches as well.
next prev parent reply other threads:[~2019-02-27 7:10 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 4:09 Ming Lei
2019-02-25 4:36 ` Dave Chinner
2019-02-25 8:46 ` Ming Lei
2019-02-25 10:03 ` Ming Lei
2019-02-25 20:11 ` Dave Chinner
2019-02-25 13:15 ` Vlastimil Babka
2019-02-25 20:26 ` Dave Chinner
2019-02-26 2:22 ` Ming Lei
2019-02-26 3:02 ` Dave Chinner
2019-02-26 3:27 ` Matthew Wilcox
2019-02-26 4:58 ` Dave Chinner
2019-02-26 9:33 ` Ming Lei
2019-02-26 10:06 ` Vlastimil Babka
2019-02-26 11:12 ` Ming Lei
2019-02-26 12:12 ` Matthew Wilcox
2019-02-26 12:35 ` Ming Lei
2019-02-26 13:02 ` Matthew Wilcox
2019-02-26 13:42 ` Ming Lei
2019-02-26 14:04 ` Matthew Wilcox
2019-02-26 16:14 ` Darrick J. Wong
2019-02-26 16:19 ` Matthew Wilcox
2019-02-27 1:41 ` Ming Lei
2019-02-27 7:07 ` Vlastimil Babka [this message]
2019-03-08 8:18 ` Christoph Hellwig
2019-02-27 21:38 ` Dave Chinner
2019-02-26 15:30 ` Christopher Lameter
2019-02-26 20:45 ` Dave Chinner
2019-02-27 1:50 ` Ming Lei
2019-02-27 3:41 ` Dave Chinner
2019-02-26 15:20 ` Christopher Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=095ae112-f98e-9516-910a-43b49ea5bf0d@suse.cz \
--to=vbabka@suse.cz \
--cc=aaron.lu@intel.com \
--cc=alexander.h.duyck@linux.intel.com \
--cc=axboe@kernel.dk \
--cc=cl@linux.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=hch@lst.de \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=tom.leiming@gmail.com \
--cc=vkuznets@redhat.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox