lkml.org 
[lkml]   [2010]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 5/6] KVM MMU: reduce kvm_mmu_page size
    On 04/12/2010 11:05 AM, Xiao Guangrong wrote:
    > 'multimapped' and 'unsync' in 'struct kvm_mmu_page' are just indication
    > field, we can use flag bits instand of them
    >
    > @@ -202,9 +202,10 @@ struct kvm_mmu_page {
    > * in this shadow page.
    > */
    > DECLARE_BITMAP(slot_bitmap, KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS);
    > - int multimapped; /* More than one parent_pte? */
    > int root_count; /* Currently serving as active root */
    > - bool unsync;
    > + #define MMU_PAGE_MULTIMAPPED 0x1 /* More than one parent_pte? */
    > + #define MMU_PAGE_UNSYNC 0x2
    > + unsigned int flags;
    > unsigned int unsync_children;
    > union {
    >

    Please just use bool for multimapped. If we grow more than 4 flags, we
    can use 'bool flag : 1;' to reduce space while retaining readability.

    --
    I have a truly marvellous patch that fixes the bug which this
    signature is too narrow to contain.



    \
     
     \ /
      Last update: 2010-04-12 10:39    [W:0.044 / U:179.464 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site