lkml.org 
[lkml]   [2012]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] KVM: Avoid checking huge page mappings in get_dirty_log()
Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> wrote:

> + while (mask) {
> + rmapp = &slot->rmap[gfn_offset + __ffs(mask)];
> + __rmap_write_protect(kvm, rmapp, PT_PAGE_TABLE_LEVEL);
>
> - return write_protected;
> + /* clear the first set bit */
> + mask &= mask - 1;
> + }
> }

while (mask) {
fsbit = __ffs(mask);
gfn_offset += fsbit;
mask >>= fsbit + 1;

rmapp = &slot->rmap[gfn_offset];
__rmap_write_protect(kvm, rmapp, PT_PAGE_TABLE_LEVEL);
}

Seems to be better: BSF friendly.

I will update this function and post the result with dirty-log-perf output!

Takuya


\
 
 \ /
  Last update: 2012-03-02 03:53    [W:0.116 / U:3.500 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site