From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNTuX-0002WJ-G5 for qemu-devel@nongnu.org; Tue, 11 Mar 2014 17:08:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNTuS-00038G-B4 for qemu-devel@nongnu.org; Tue, 11 Mar 2014 17:08:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNTuS-00036e-3j for qemu-devel@nongnu.org; Tue, 11 Mar 2014 17:08:24 -0400 From: Juan Quintela In-Reply-To: <1394542415-5152-9-git-send-email-arei.gonglei@huawei.com> (arei gonglei's message of "Tue, 11 Mar 2014 20:53:33 +0800") References: <1394542415-5152-1-git-send-email-arei.gonglei@huawei.com> <1394542415-5152-9-git-send-email-arei.gonglei@huawei.com> Date: Tue, 11 Mar 2014 22:08:16 +0100 Message-ID: <87siqo1m0v.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 08/10] migration: s/uint64_t/int64_t the definitions of it_age Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: ChenLiang , weidong.huang@huawei.com, qemu-devel@nongnu.org, owasserm@redhat.com, pbonzini@redhat.com wrote: > From: ChenLiang > > Signed-off-by: ChenLiang > Signed-off-by: Gonglei You are changing teh types introduced in patch2, please fix them there? Anyways, why are you changing the age to int64_t? Not that I expect it to be so big, but I would expect it not to be negative? Later, Juan. > --- > arch_init.c | 4 ++-- > include/migration/page_cache.h | 4 ++-- > page_cache.c | 6 +++--- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch_init.c b/arch_init.c > index 461a10a..1c1488a 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -109,7 +109,7 @@ const uint32_t arch_type = QEMU_ARCH; > static bool mig_throttle_on; > static void check_guest_throttling(void); > > -static uint64_t bitmap_sync_cnt; > +static int64_t bitmap_sync_cnt; > /* the functions *_bitmap_sync_cnt only run in migrate thread */ > static inline void reset_bitmap_sync_cnt(void) > { > @@ -121,7 +121,7 @@ static inline void increase_bitmap_sync_cnt(void) > bitmap_sync_cnt++; > } > > -static inline uint64_t get_bitmap_sync_cnt(void) > +static inline int64_t get_bitmap_sync_cnt(void) > { > return bitmap_sync_cnt; > } > diff --git a/include/migration/page_cache.h b/include/migration/page_cache.h > index dc0c6b5..34518ba 100644 > --- a/include/migration/page_cache.h > +++ b/include/migration/page_cache.h > @@ -46,7 +46,7 @@ void cache_fini(PageCache *cache); > * @current_age indicate the age of the page if cache hit > */ > bool cache_is_cached(const PageCache *cache, uint64_t addr, > - uint64_t current_age); > + int64_t current_age); > > /** > * get_cached_data: Get the data cached for an addr > @@ -70,7 +70,7 @@ uint8_t *get_cached_data(const PageCache *cache, uint64_t addr); > * @current_age indicate the age of the page if the page is inserted into cache > */ > int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata, > - uint64_t current_age); > + int64_t current_age); > > /** > * cache_resize: resize the page cache. In case of size reduction the extra > diff --git a/page_cache.c b/page_cache.c > index 579330c..b32afdc 100644 > --- a/page_cache.c > +++ b/page_cache.c > @@ -40,7 +40,7 @@ typedef struct CacheItem CacheItem; > > struct CacheItem { > uint64_t it_addr; > - uint64_t it_age; > + int64_t it_age; > uint8_t *it_data; > }; > > @@ -140,7 +140,7 @@ uint8_t *get_cached_data(const PageCache *cache, uint64_t addr) > } > > bool cache_is_cached(const PageCache *cache, uint64_t addr, > - uint64_t current_age) > + int64_t current_age) > { > CacheItem *it = NULL; > > @@ -155,7 +155,7 @@ bool cache_is_cached(const PageCache *cache, uint64_t addr, > } > > int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata, > - uint64_t current_age) > + int64_t current_age) > { > > CacheItem *it = NULL;