From patchwork Fri Oct 10 11:43:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 38555 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E194D202DB for ; Fri, 10 Oct 2014 11:48:10 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf717643wib.5 for ; Fri, 10 Oct 2014 04:48:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=1xOuH6m2pRwfOTgs3R+6m1zFIYN+NYckk9K7cLAXptM=; b=iDaHybn/wJn/ho/5a+HLFZ1Oem2Yd/U3f+XrblsDtsiQb5kWloydNTgWXbQVyJ1VUI 490HiwmGvpGt8mXykVmJjadeYxdYRmDoLsZmroRKif6fzzWSOnTc51fOBslKUGUZWZXf PQUOGbrWDJtTBFtStlpxAoCFb6GfzZqn8joHk5PuZa6MieaNBcXm/maud0HDrSKYXFW6 eIvCjD+uW2h25U8pJvobi6Hp5P5TbWNKjfrwFkY4N9VVNMNkO39nRkjAtQf3r3Zc0W9b rjTeFl/J1lc5x5mm6otYFwtZIY10SHj6DgqOrQTdM72Ywfhalh/DdFooS4R/qlOuClyF GirA== X-Gm-Message-State: ALoCoQnpmc6ffAGB/te6hGi769NlefxSa7RLfHw4XNcjV/6DZ1OFRPCa8+mnw4QrLjLMCDczHxeW X-Received: by 10.152.43.66 with SMTP id u2mr886144lal.1.1412941689995; Fri, 10 Oct 2014 04:48:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.100 with SMTP id z4ls277117laz.60.gmail; Fri, 10 Oct 2014 04:48:09 -0700 (PDT) X-Received: by 10.112.185.68 with SMTP id fa4mr4017107lbc.77.1412941689526; Fri, 10 Oct 2014 04:48:09 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx.google.com with ESMTPS id dk7si8865179lad.51.2014.10.10.04.48.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:48:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id u10so2936761lbd.15 for ; Fri, 10 Oct 2014 04:48:09 -0700 (PDT) X-Received: by 10.112.190.69 with SMTP id go5mr4163186lbc.32.1412941689410; Fri, 10 Oct 2014 04:48:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp411649lbz; Fri, 10 Oct 2014 04:48:08 -0700 (PDT) X-Received: by 10.52.116.240 with SMTP id jz16mr322033vdb.71.1412941683632; Fri, 10 Oct 2014 04:48:03 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id b15si6623055vct.26.2014.10.10.04.48.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:48:03 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcYeQ-0007lB-Ar; Fri, 10 Oct 2014 11:46:26 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcYeP-0007kt-4x for xen-devel@lists.xensource.com; Fri, 10 Oct 2014 11:46:25 +0000 Received: from [85.158.143.35:38412] by server-2.bemta-4.messagelabs.com id 71/1F-04525-017C7345; Fri, 10 Oct 2014 11:46:24 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1412941582!12094959!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25256 invoked from network); 10 Oct 2014 11:46:23 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 10 Oct 2014 11:46:23 -0000 X-IronPort-AV: E=Sophos;i="5.04,691,1406592000"; d="scan'208";a="180112516" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 10 Oct 2014 07:46:21 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XcYeG-0008F6-8b; Fri, 10 Oct 2014 12:46:16 +0100 From: Stefano Stabellini To: Date: Fri, 10 Oct 2014 12:43:54 +0100 Message-ID: <1412941440-5646-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v4 1/7] xen: introduce gnttab_max_nr_maptrack_frames command line option X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Introduce a new Xen command line option to specify the max number of maptrack frames per domain. Signed-off-by: Stefano Stabellini --- docs/misc/xen-command-line.markdown | 6 ++++++ xen/common/grant_table.c | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index 389701a..acf6208 100644 --- a/docs/misc/xen-command-line.markdown +++ b/docs/misc/xen-command-line.markdown @@ -613,6 +613,12 @@ Specify the serial parameters for the GDB stub. Specify the maximum number of frames per grant table operation. +### gnttab\_max\_nr\_maptrack\_frames +> `= ` + +Specify the maximum number of maptrack frames domain. +The default value is 8 times gnttab_max_nr_frames. + ### guest\_loglvl > `= [/]` where level is `none | error | warning | info | debug | all` diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 23266c3..5451c75 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -102,10 +102,9 @@ nr_maptrack_frames(struct grant_table *t) return t->maptrack_limit / MAPTRACK_PER_PAGE; } -static unsigned inline int max_nr_maptrack_frames(void) -{ - return (max_nr_grant_frames * MAX_MAPTRACK_TO_GRANTS_RATIO); -} +static unsigned int max_nr_maptrack_frames = DEFAULT_MAX_NR_GRANT_FRAMES * + MAX_MAPTRACK_TO_GRANTS_RATIO; +integer_param("gnttab_max_nr_maptrack_frames", max_nr_maptrack_frames); #define MAPTRACK_TAIL (~0u) @@ -271,7 +270,7 @@ get_maptrack_handle( while ( unlikely((handle = __get_maptrack_handle(lgt)) == -1) ) { nr_frames = nr_maptrack_frames(lgt); - if ( nr_frames >= max_nr_maptrack_frames() ) + if ( nr_frames >= max_nr_maptrack_frames ) break; new_mt = alloc_xenheap_page(); @@ -2659,7 +2658,7 @@ grant_table_create( /* Tracking of mapped foreign frames table */ if ( (t->maptrack = xzalloc_array(struct grant_mapping *, - max_nr_maptrack_frames())) == NULL ) + max_nr_maptrack_frames)) == NULL ) goto no_mem_2; if ( (t->maptrack[0] = alloc_xenheap_page()) == NULL ) goto no_mem_3;