Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752837AbbHJNhL (ORCPT ); Mon, 10 Aug 2015 09:37:11 -0400 Received: from smtp.citrix.com ([66.165.176.89]:28370 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbbHJNhI (ORCPT ); Mon, 10 Aug 2015 09:37:08 -0400 X-IronPort-AV: E=Sophos;i="5.15,645,1432598400"; d="scan'208";a="289645664" Message-ID: <55C8A8CA.7070409@citrix.com> Date: Mon, 10 Aug 2015 14:36:10 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Stefano Stabellini CC: Wei Liu , , "Konrad Rzeszutek Wilk" , , David Vrabel , , Boris Ostrovsky , Subject: Re: [PATCH v3 12/20] xen/balloon: Don't rely on the page granularity is the same for Xen and Linux References: <1438966019-19322-1-git-send-email-julien.grall@citrix.com> <1438966019-19322-13-git-send-email-julien.grall@citrix.com> <55C88B77.8030700@citrix.com> In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1029 Lines: 27 On 10/08/15 13:55, Stefano Stabellini wrote: >> If your only concern is the size of the array, we could decrease the >> number of frames by batch. Or allocation the variable once a boot time. > > Yes, that is my only concern. Allocating only nr_pages new struct page* > would be good enough I guess. That would be even worst. We shouldn't allocate the array at every call, but at boot time. Note that frame_list is already a static variable use 64KB when 64KB page is used. I guess this will be unlikely to remove that much frame in a single batch. But I will keep this optimization for later. Anyway, I'm wondering if we could re-use the lru field to link the page when allocate them and retrieve in the second loop in order to avoid the pages array. Regards, -- Julien Grall -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/