On 3/25/21 12:42 PM, Mel Gorman wrote:
> From: Jesper Dangaard Brouer
>
> Looking at perf-report and ASM-code for __alloc_pages_bulk() it is clear
> that the code activated is suboptimal. The compiler guesses wrong and
> places unlikely code at the beginning. Due to the use of WARN_ON_ONCE()
> ma
On Thu, Mar 25, 2021 at 12:12:17PM +, Matthew Wilcox wrote:
> On Thu, Mar 25, 2021 at 11:42:23AM +, Mel Gorman wrote:
> >
> > - if (WARN_ON_ONCE(nr_pages <= 0))
> > + if (unlikely(nr_pages <= 0))
> > return 0;
>
> If we made nr_pages unsigned, we wouldn't need this check
On Thu, Mar 25, 2021 at 11:42:23AM +, Mel Gorman wrote:
>
> - if (WARN_ON_ONCE(nr_pages <= 0))
> + if (unlikely(nr_pages <= 0))
> return 0;
If we made nr_pages unsigned, we wouldn't need this check at all (ok,
we'd still need to figure out what to do with 0). But then,
From: Jesper Dangaard Brouer
Looking at perf-report and ASM-code for __alloc_pages_bulk() it is clear
that the code activated is suboptimal. The compiler guesses wrong and
places unlikely code at the beginning. Due to the use of WARN_ON_ONCE()
macro the UD2 asm instruction is added to the code, w