From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxD0O-0004xh-1Y for qemu-devel@nongnu.org; Tue, 26 May 2015 07:26:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxD0K-0007zG-T2 for qemu-devel@nongnu.org; Tue, 26 May 2015 07:26:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxD0K-0007zC-Ld for qemu-devel@nongnu.org; Tue, 26 May 2015 07:26:40 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4QBQeQR010834 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 26 May 2015 07:26:40 -0400 Date: Tue, 26 May 2015 19:26:36 +0800 From: Fam Zheng Message-ID: <20150526112636.GS13749@ad.nay.redhat.com> References: <1430152117-100558-1-git-send-email-pbonzini@redhat.com> <1430152117-100558-21-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430152117-100558-21-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 20/29] exec: invert return value of cpu_physical_memory_get_clean, rename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com On Mon, 04/27 18:28, Paolo Bonzini wrote: > While it is obvious that cpu_physical_memory_get_dirty returns true even if > a single page is dirty, the same is not true for cpu_physical_memory_get_clean; > one would expect that it returns true only if all the pages are clean, but > it actually looks for even one clean page. (By contrast, the caller of that > function, cpu_physical_memory_range_includes_clean, has a good name). > > To clarify, rename the function to cpu_physical_memory_all_dirty and return > true if _all_ the pages are dirty. This is the opposite of the previous > meaning, because "all are 1" is the same as "not (any is 0)", so we have to > modify cpu_physical_memory_range_includes_clean as well. > > Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Then maybe we can rename cpu_physical_memory_is_clean to cpu_physical_memory_has_clean, or as you suggested, cpu_physical_memory_needs_notdirty (but wait, what is 'notdirty'? :), for a similar reason. Fam