[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/ukallocbbuddy: Fix the number of pages when resetting memory regions



As far as I can tell, this patch looks good. Thanks!

Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 03.04.19, 12:43, "Costin Lupu" <costin.lupu@xxxxxxxxx> wrote:

    If len=0x7ec2000, when using the formula we get memr->nr_pages=32448. On
    the other hand range value becomes 0x7ec1000 and (range >> __PAGE_SHIFT)
    == 32449 which is wrong. Therefore we should memr->nr_pages as the
    correct number of pages.
    
    Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
    ---
     lib/ukallocbbuddy/bbuddy.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/lib/ukallocbbuddy/bbuddy.c b/lib/ukallocbbuddy/bbuddy.c
    index 13a7942b..7f6aad51 100644
    --- a/lib/ukallocbbuddy/bbuddy.c
    +++ b/lib/ukallocbbuddy/bbuddy.c
    @@ -411,7 +411,7 @@ static int bbuddy_addmem(struct uk_alloc *a, void 
*base, size_t len)
                        memr->mm_alloc_bitmap_size);
     
        /* free up the memory we've been given to play with */
    -   map_free(b, min, (unsigned long)(range >> __PAGE_SHIFT));
    +   map_free(b, min, memr->nr_pages);
     
        count = 0;
        while (range != 0) {
    -- 
    2.11.0
    
    

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.