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

Re: [Xen-devel] [PATCH v5 1/2] xen: replace tlbflush check and operation with inline functions



>>> On 19.09.16 at 04:50, <dongli.zhang@xxxxxxxxxx> wrote:
> This patch cleaned up the code by replacing complicated tlbflush check and
> operation with inline functions. We should use those inline functions to
> avoid the complicated tlbflush check and tlbflush operations when
> implementing TODOs left in commit a902c12ee45fc9389eb8fe54eeddaf267a555c58
> (More efficient TLB-flush filtering in alloc_heap_pages()).
> 
> "#include <asm/flushtlb.h>" is removed from xen/arch/x86/acpi/suspend.c to
> avoid the compiling error after we include "<asm/flushtlb.h>" to
> xen/include/xen/mm.h.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@xxxxxxxxxx>
> ---
> Changed since v4:
>   * Wrap the filtered tlbflush mask operation as inline function (suggested
>     by Jan).

That was only one half of my request, the other half was to ...

> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -827,10 +827,8 @@ static struct page_info *alloc_heap_pages(
>          BUG_ON(pg[i].count_info != PGC_state_free);
>          pg[i].count_info = PGC_state_inuse;
>  
> -        if ( pg[i].u.free.need_tlbflush &&
> -             (pg[i].tlbflush_timestamp <= tlbflush_current_time()) &&
> -             (!need_tlbflush ||
> -              (pg[i].tlbflush_timestamp > tlbflush_timestamp)) )
> +        if ( accumulate_tlbflush(need_tlbflush, &pg[i],
> +                                 tlbflush_timestamp) )
>          {
>              need_tlbflush = 1;
>              tlbflush_timestamp = pg[i].tlbflush_timestamp;

... also move the if() including its body into the helper (whether you
make the new value of need_tlbflush the return value or handle it
via indirection is up to you).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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