All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] nr_pfns miscalculated
@ 2005-05-12 11:22 Scott Parish
  2005-05-12 13:45 ` Christian Limpach
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Parish @ 2005-05-12 11:22 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

If i'm not mistaken, this was what was intended.

sRp

-- 
Scott Parish
Signed-off-by: srparish@us.ibm.com

[-- Attachment #2: nr_pfns.diff --]
[-- Type: text/plain, Size: 582 bytes --]

--- old-xen-unstable/xen/arch/x86/mm.c	2005-05-11 17:42:05.000000000 +0000
+++ new-xen-unstable/xen/arch/x86/mm.c	2005-05-12 11:05:15.000000000 +0000
@@ -209,9 +209,7 @@
         if ( e820.map[i].type == E820_RAM )
             continue;
         pfn = e820.map[i].addr >> PAGE_SHIFT;
-        nr_pfns = (e820.map[i].size +
-                   (e820.map[i].addr & ~PAGE_MASK) +
-                   ~PAGE_MASK) >> PAGE_SHIFT;
+        nr_pfns = (e820.map[i].size + ~PAGE_MASK) >> PAGE_SHIFT;
         for ( j = 0; j < nr_pfns; j++ )
         {
             if ( !pfn_valid(pfn+j) )


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] nr_pfns miscalculated
  2005-05-12 11:22 [patch] nr_pfns miscalculated Scott Parish
@ 2005-05-12 13:45 ` Christian Limpach
  2005-05-12 13:58   ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Limpach @ 2005-05-12 13:45 UTC (permalink / raw)
  To: Scott Parish; +Cc: xen-devel

On 5/12/05, Scott Parish <srparish@us.ibm.com> wrote:
> If i'm not mistaken, this was what was intended.

Looks to me like the current code tries to handle the case where an
e820 entry starts not on a page boundary -- not sure this is needed...

    christian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] nr_pfns miscalculated
  2005-05-12 13:45 ` Christian Limpach
@ 2005-05-12 13:58   ` Keir Fraser
  2005-05-12 13:58     ` Christian Limpach
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2005-05-12 13:58 UTC (permalink / raw)
  To: Christian.Limpach; +Cc: xen-devel, Scott Parish


On 12 May 2005, at 14:45, Christian Limpach wrote:

> Looks to me like the current code tries to handle the case where an
> e820 entry starts not on a page boundary -- not sure this is needed...

It's probably rounding the wrong way: should consider only pages 
completely covered by the e820 range.

  -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] nr_pfns miscalculated
  2005-05-12 13:58   ` Keir Fraser
@ 2005-05-12 13:58     ` Christian Limpach
  2005-05-12 14:06       ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Limpach @ 2005-05-12 13:58 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, Scott Parish

On Thu, May 12, 2005 at 02:58:10PM +0100, Keir Fraser wrote:
> 
> On 12 May 2005, at 14:45, Christian Limpach wrote:
> 
> >Looks to me like the current code tries to handle the case where an
> >e820 entry starts not on a page boundary -- not sure this is needed...
> 
> It's probably rounding the wrong way: should consider only pages 
> completely covered by the e820 range.

At least the current code is consistent.

    christian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] nr_pfns miscalculated
  2005-05-12 13:58     ` Christian Limpach
@ 2005-05-12 14:06       ` Keir Fraser
  0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2005-05-12 14:06 UTC (permalink / raw)
  To: Christian Limpach; +Cc: xen-devel, Scott Parish


On 12 May 2005, at 14:58, Christian Limpach wrote:

> On Thu, May 12, 2005 at 02:58:10PM +0100, Keir Fraser wrote:
>>
>> On 12 May 2005, at 14:45, Christian Limpach wrote:
>>
>>> Looks to me like the current code tries to handle the case where an
>>> e820 entry starts not on a page boundary -- not sure this is 
>>> needed...
>>
>> It's probably rounding the wrong way: should consider only pages
>> completely covered by the e820 range.
>
> At least the current code is consistent.
>
>     christian

Actually it's deciding what should be marked as 'I/O memory'. The 
current code includes fractional pages -- since such pages are never 
registered with the RAM allocator, this policy doesn't seem harmful.

  -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-12 14:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-12 11:22 [patch] nr_pfns miscalculated Scott Parish
2005-05-12 13:45 ` Christian Limpach
2005-05-12 13:58   ` Keir Fraser
2005-05-12 13:58     ` Christian Limpach
2005-05-12 14:06       ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.