How about this now?

On Tue, May 31, 2011 at 12:03:49AM +0100, Owain Ainsworth wrote:
> It will handle an empty list just fine (there is a potential small
> optimisation in there to avoid grabbing the fpageqlock if no pages need
> freeing but that is another diff)
> 
> ok?
> 
> diff --git uvm/uvm_km.c uvm/uvm_km.c
> index 1990adf..818cb18 100644
> --- uvm/uvm_km.c
> +++ uvm/uvm_km.c
> @@ -925,8 +925,7 @@ alloc_va:
>               while (uvm_km_pages.free == 0) {
>                       if (kd->kd_waitok == 0) {
>                               mtx_leave(&uvm_km_pages.mtx);
> -                             if (!TAILQ_EMPTY(&pgl))
> -                                     uvm_pglistfree(&pgl);
> +                             uvm_pglistfree(&pgl);
>                               return NULL;
>                       }
>                       msleep(&uvm_km_pages.free, &uvm_km_pages.mtx, PVM,
> @@ -959,8 +958,7 @@ try_map:
>                               tsleep(map, PVM, "km_allocva", 0);
>                               goto try_map;
>                       }
> -                     if (!TAILQ_EMPTY(&pgl))
> -                             uvm_pglistfree(&pgl);
> +                     uvm_pglistfree(&pgl);
>                       return (NULL);
>               }
>       }
> -- 
> 1.7.5
> 
> -- 
> Banectomy, n.:
>       The removal of bruises on a banana.
>               -- Rich Hall, "Sniglets"

-- 
"Matrimony isn't a word, it's a sentence."

Reply via email to