lib/alloc_page: Properly handle requests for fresh blocks

Upon initialization, all memory in an area is marked as fresh. Once
memory is used and freed, the freed memory is marked as free.

Free memory is always appended to the front of the freelist, meaning
that fresh memory stays on the tail.

When a block of fresh memory is split, the two blocks are put on the
tail of the appropriate freelist, so they can be found when needed.

When a fresh block is requested, a fresh block one order bigger is
taken, the first half is put back in the free pool (on the tail), and
the second half is returned. The reason behind this is that the first
page of every block always contains the pointers of the freelist.
Since the first page of a fresh block is actually not fresh, it cannot
be returned when a fresh allocation is requested.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
9 jobs for page_allocator_fixes in 4 minutes and 53 seconds (queued for 2 seconds)
latest
Status Name Job ID Coverage
  Test
passed build-aarch64 #964074609

00:02:21

passed build-arm #964074610

00:02:22

passed build-centos7 #964074618

00:02:49

passed build-clang #964074617

00:02:44

passed build-i386 #964074616

00:03:23

passed build-ppc64be #964074611

00:01:57

passed build-ppc64le #964074612

00:02:11

passed build-s390x #964074613

00:04:52

passed build-x86_64 #964074615

00:03:59