Thread (75 messages) 75 messages, 9 authors, 2020-02-05

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

From: Segher Boessenkool <hidden>
Date: 2020-02-04 13:14:34
Also in: linux-arm-kernel, linux-mm, linux-s390, linux-sh, lkml

On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote:
On 04.02.20 10:46, Oscar Salvador wrote:
quoted
I have to confess that it took me while to wrap around my head
with the new min() change, but looks ok:
It's a pattern commonly used in compilers and emulators to calculate the
number of bytes to the next block/alignment. (we're missing a macro
(like we have ALIGN_UP/IS_ALIGNED) for that - but it's hard to come up
with a good name (e.g., SIZE_TO_NEXT_ALIGN) .
You can just write the easy to understand

  ...  ALIGN_UP(x) - x  ...

which is better *without* having a separate name.  Does that not
generate good machine code for you?


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help