lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 12 Jan 2023 07:27:32 +0800
From:   Qu Wenruo <quwenruo.btrfs@....com>
To:     dsterba@...e.cz
Cc:     zys.zljxml@...il.com, clm@...com, josef@...icpanda.com,
        dsterba@...e.com, linux-btrfs@...r.kernel.org,
        linux-kernel@...r.kernel.org, Yushan Zhou <katrinzhou@...cent.com>
Subject: Re: [PATCH v3] btrfs: use PAGE_{ALIGN, ALIGNED, ALIGN_DOWN} macro



On 2023/1/12 02:40, David Sterba wrote:
> On Tue, Jan 03, 2023 at 01:47:43PM +0800, Qu Wenruo wrote:
>>
>>
>> On 2023/1/3 13:11, zys.zljxml@...il.com wrote:
>>> From: Yushan Zhou <katrinzhou@...cent.com>
>>>
>>> The header file linux/mm.h provides PAGE_ALIGN, PAGE_ALIGNED,
>>> PAGE_ALIGN_DOWN macros. Use these macros to make code more
>>> concise.
>>
>> Is there anything benefit from the change?
>>
>> In fact, PAGE_ALIGN()/PAGE_ALIGNED() is just using the same
>> ALIGN()/IS_ALIGNED() macro.
>>
>> Thus I don't think your change is of any usefulness, not to mention it's
>> going to introduce confusion and extra effort.
>>
>> I'm completely fine with regular ALIGN()/IS_ALIGNED() usage with PAGE_SIZE.
> 
> We already have PAGE_ALIGN in some places and I think it's a bit better
> than the ALIGN/IS_ALIGN as it's clear that it's for a page.

I'd argue that PAGE_ALIGN() is good for MM code, which btrfs has some.

But overall, btrfs is more about sector alignment, and if we need to mix 
them, regular ALIGN() would be more flex.

Thanks,
Qu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ