From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754111AbdGCQRA (ORCPT ); Mon, 3 Jul 2017 12:17:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:36555 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752769AbdGCQQ6 (ORCPT ); Mon, 3 Jul 2017 12:16:58 -0400 Subject: Re: [Xen-devel] [PATCH] xen/balloon: don't online new memory initially To: Jan Beulich Cc: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, linux-kernel@vger.kernel.org References: <20170703154037.17851-1-jgross@suse.com> <595A88C202000078001680C2@suse.com> From: Juergen Gross Message-ID: Date: Mon, 3 Jul 2017 18:16:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <595A88C202000078001680C2@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/07/17 18:11, Jan Beulich wrote: >>>> On 03.07.17 at 17:40, wrote: >> --- a/drivers/xen/xen-balloon.c >> +++ b/drivers/xen/xen-balloon.c >> @@ -59,6 +59,8 @@ static void watch_target(struct xenbus_watch *watch, >> { >> unsigned long long new_target; >> int err; >> + static bool watch_fired; >> + static unsigned long target_diff; > > It would seem to me that the types of target_diff and new_target > should match in width, but differ in signedness. The different width is on purpose: new_target is in kB, so it could exceed the max page count on 32 bit systems (not that it would matter as a guest of that size isn't possible). target_diff is a page count so it will always fit into a long int. Regarding signedness you are right. I probably should switch to long for target_diff. Juergen