Re: [PATCH] btrfs: fix allocation of bitmap pages.

From: Vlastimil Babka
Date: Tue Aug 20 2019 - 07:06:29 EST


On 8/20/19 4:30 AM, Christoph Hellwig wrote:
> On Mon, Aug 19, 2019 at 07:46:00PM +0200, David Sterba wrote:
>> Another thing that is lost is the slub debugging support for all
>> architectures, because get_zeroed_pages lacking the red zones and sanity
>> checks.
>>
>> I find working with raw pages in this code a bit inconsistent with the
>> rest of btrfs code, but that's rather minor compared to the above.
>>
>> Summing it up, I think that the proper fix should go to copy_page
>> implementation on architectures that require it or make it clear what
>> are the copy_page constraints.
>
> The whole point of copy_page is to copy exactly one page and it makes
> sense to assume that is aligned. A sane memcpy would use the same
> underlying primitives as well after checking they fit. So I think the
> prime issue here is btrfs' use of copy_page instead of memcpy. The
> secondary issue is slub fucking up alignments for no good reason. We
> just got bitten by that crap again in XFS as well :(

Meh, I should finally get back to https://lwn.net/Articles/787740/ right