[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/arm: add warning if memory modules overlap
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |