From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752152AbdARSN1 (ORCPT ); Wed, 18 Jan 2017 13:13:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57644 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbdARSNZ (ORCPT ); Wed, 18 Jan 2017 13:13:25 -0500 Date: Wed, 18 Jan 2017 19:11:57 +0100 From: Andrea Arcangeli To: Claudio Imbrenda Cc: linux-mm@kvack.org, borntraeger@de.ibm.com, hughd@google.com, izik.eidus@ravellosystems.com, chrisw@sous-sol.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/1] mm/ksm: improve deduplication of zero pages with colouring Message-ID: <20170118181157.GI10177@redhat.com> References: <1484237834-15803-1-git-send-email-imbrenda@linux.vnet.ibm.com> <20170112172132.GM4947@redhat.com> <1e1e7589-9713-e6a4-f57c-bfd94eb3e1e9@linux.vnet.ibm.com> <20170118162914.GF10177@redhat.com> <4ac20fb0-d9d2-e73f-2f17-1f69929756b7@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ac20fb0-d9d2-e73f-2f17-1f69929756b7@linux.vnet.ibm.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 18 Jan 2017 18:12:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 18, 2017 at 06:17:09PM +0100, Claudio Imbrenda wrote: > That's true. As I said above, my previous example was not very well > thought. The more realistic scenario is that of having the colored zero > pages of a guest merged. That's a good point for making a special case that retains the coloring of those guest pages, agreed. Retaining the coloring of guest zero pages is however a different "feature" than what KSM was supposed to run for though, I mean the guest may run faster with KSM than without because without KSM you wouldn't know which host physical page is allocated for each guest zero page. If you wanted top performance then you wouldn't know if to enable KSM or not. I wonder if the zero page coloring would be better solved with a vhost-zeropage dedicated mechanism that would be always enabled regardless if KSM is enabled or not. KSM is generally a CPU vs memory tradeoff, and it's in general good idea to enable it. It's also ok if KSM improves performance of course, definitely not forbidden in fact it's ideal, but my point is, the rest of KSM might decrease performance too, so if you need a top-performance setup for benchmarks or for some special usage, it'd be hard to decide if to enable KSM or not on those archs requiring page coloring. Thanks, Andrea