From: Mukesh Rathor Subject: Re: xen/pvh linux: Use ballooning to allocate grant table pages Date: Fri, 8 Feb 2013 15:50:43 -0800 Message-ID: <20130208155043.04f99410@mantra.us.oracle.com> References: <20130207105425.GA1597@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130207105425.GA1597@elgon.mountain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dan Carpenter Cc: kbuild@01.org, xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Thu, 7 Feb 2013 13:54:25 +0300 Dan Carpenter wrote: > Hello Mukesh Rathor, > > The patch 40f633eb0def: "xen/pvh linux: Use ballooning to allocate > grant table pages" from Jan 31, 2013, leads to the following Sparse > warning: "drivers/xen/grant-table.c:1095:28: error: bad constant > expression" > > drivers/xen/grant-table.c > 1092 static int xlated_setup_gnttab_pages(int numpages, void > **addr) 1093 { > 1094 int i, rc; > 1095 unsigned long pfns[numpages]; > 1096 struct page *pages[numpages]; > ^^^^^^^^ > Because the kernel uses an 8k stack if this is over 500 it will cause > a kernel crash. It will crash before we reach 500 actually. It looks > like typical values for this are around 4 so we're probably safe, but > it's still a bit nasty. > > 1097 > 1098 rc = alloc_xenballooned_pages(numpages, pages, 0); > 1099 if (rc != 0) { > 1100 pr_warn("%s Could not balloon alloc %d pfns > rc:%d\n", __func__, > > regards, > dan carpenter Hi Dan, Yeah, I know. Currently, there is a hard max on num of grant pages to 32, but on average are lot less. So I think it should be OK. Konrad, do you still want me to change it to kmalloc? Thanks Mukesh