>>> On 19.09.16 at 04:50, <dongli.zh...@oracle.com> 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
> Signed-off-by: Dongli Zhang <dongli.zh...@oracle.com>
> 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).
Xen-devel mailing list