[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/arm: add warning if memory modules overlap


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Brian Woods <brian.woods@xxxxxxxxxx>
  • Date: Fri, 11 Oct 2019 12:07:51 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=epam.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jssaC8UNWujNf4OhP//p2Djuoh4ACmda1Syd08fk8Jo=; b=EDhEyH5d6GIMsYpcckXFmM+7JD2qvzeg3/SUR0J31tgT0sbhWmdlGkJa4BH8smAe6iHoXboEO0bkPIe5IHbjE+oKROpjjSanIReliOhU8f0nG/oJXK1BQthIVAF6aO0OX4xa+pd9Wwp6qeVwdbLT/lbqmkLS9LnewIPNT4YbcSP65mpzvRJoCm0QQtF4DUWHNStKthH3GMztgKiFgtVrABdkH741m+vRF4XXk+GtvEhENgM5AgUeWnvD3Fb5lw6ziW7OIPFuBXtjMe993RYRh9sBmw0DJBC3tA0C3FuvzqQUPxLffNUMfuzlARu3NJBBjEQVI/2nowl99cY4HMpNvw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iSI4/wVf4wHpyrY309ZyBZHfakPQ2jxlLGXsOaLP3pKwVFfG9RdEvUHg6zGv87C2AoBZWCkWBItWX9ZSJmt1HZ9A46JyXS9rPRJmCSTt/oL7/N8T12L2kdmDUDEplvzrE5jj+M3vqClUP0trXSVaKUVFso3Sr1A2GCszdZG5rTqG42WA1BcUR2FscFJFRdPMeuLpM0BvAv289KDXWlCM7+dbmGi6+VidXMuSUjT5uTA88YtORT/lpVjOvc91Dia/lfWE2uiNhpj4FPV7XIuSpTAT3CWeqQ0j3ZE/3MGxR8Ax5IA1czRWmZbtbW5hTbbzo+I1b2XO6itf1+mVo43AgA==
  • Authentication-results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; epam.com; dkim=none (message not signed) header.d=none;epam.com; dmarc=bestguesspass action=none header.from=xilinx.com;
  • Cc: Brian Woods <brian.woods@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 11 Oct 2019 19:08:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Oct 11, 2019 at 07:17:29PM +0100, Julien Grall wrote:
> Hi,
> 
> On 10/11/19 7:06 PM, Brian Woods wrote:
> >On Fri, Oct 11, 2019 at 05:58:35PM +0100, Julien Grall wrote:
> >For that, you'd need to either check the start and end of the added
> >module or the start of both.  So something like:
> >
> >if ( ((mod->start >= start) && (mod->start < (start + size))) ||
> >      ((start >= mod->start) && (start < (mod->start + mod->size))) )
> >     printk("WARNING: ...");
> >
> >If you don't you run the risk of having a module overlap but not at the
> >start of the added module (unless there's a guaranteed order).  You're
> >still running all of the checks from what I can tell, just not in nested
> >for loop so. Plus I'm not sure how many times add_boot_module gets run
> >and the "mod->kind == kind .." if statement gets run and is true.
> >If the above is true, wouldn't that cause extra checks for the for loop
> >iterations before it was true?
> 
> For non-dom0less case, we are talking about 4 modules max (Xen, Kernel,
> Initramfs, flask policy). Modules cannot be the shared here.
> 
> For dom0less, you are unlikely to have that many domains started from Xen.
> So the number of modules will still be limited (even more if you share it).

Not arguing that.  With the second loop (checking two start addresses)
it's only n(n-1)/2 iterations. Even if you had 12 memory modules, it's
only 66 iterations.  In the large scheme of things, that isn't THAT
many.

> This code is also only called at boot where there are bigger time consuming
> part (such as domheap initialization). So I would be surprised if you see
> any improvement (other than a couple of cycles) in boot time here.
> 
> Therefore, I would favor a readable solution over a micro-optimized solution
> here.

Which is why I wanted to put it where it was in the patch.  Where the
user would see the warning after the information about the memory
modules were printed (and fair early).

Either way, take your pick of location and if it's only debug or not and
I can write it up and test it.

Brian

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.