public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Small hugetlbpage.c fix
@ 2006-05-05  8:52 Zoltan Menyhart
  2006-05-05 16:44 ` Luck, Tony
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zoltan Menyhart @ 2006-05-05  8:52 UTC (permalink / raw)
  To: linux-ia64

--- linux-2.6.16.9-save/arch/ia64/mm/hugetlbpage.c	2006-04-21 09:58:55.000000000 +0200
+++ linux-2.6.16.9/arch/ia64/mm/hugetlbpage.c	2006-05-05 10:35:14.000000000 +0200
@@ -125,9 +125,9 @@
 
 	addr = htlbpage_to_page(addr);
 	end  = htlbpage_to_page(end);
-	if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE))
+	if (is_hugepage_only_range((*tlb)->mm, floor, HPAGE_SIZE))
 		floor = htlbpage_to_page(floor);
-	if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE))
+	if (is_hugepage_only_range((*tlb)->mm, ceiling, HPAGE_SIZE))
 		ceiling = htlbpage_to_page(ceiling);
 
 	free_pgd_range(tlb, addr, end, floor, ceiling);

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

* RE: Small hugetlbpage.c fix
  2006-05-05  8:52 Small hugetlbpage.c fix Zoltan Menyhart
@ 2006-05-05 16:44 ` Luck, Tony
  2006-05-05 18:45 ` Chen, Kenneth W
  2006-05-05 19:06 ` Chen, Kenneth W
  2 siblings, 0 replies; 4+ messages in thread
From: Luck, Tony @ 2006-05-05 16:44 UTC (permalink / raw)
  To: linux-ia64

Greg, Chris:

2.6.17-rcN has moved on and changed this in other ways, but
this patch looks like a candidate for the stable series.
What's there looks like it should kick a warning, if not a
full blown error from the compiler for getting the type wrong.

-Tony

-----Original Message-----
From: linux-ia64-owner@vger.kernel.org [mailto:linux-ia64-owner@vger.kernel.org] On Behalf Of Zoltan Menyhart
Sent: Friday, May 05, 2006 1:53 AM
To: linux-ia64@vger.kernel.org
Subject: Small hugetlbpage.c fix

--- linux-2.6.16.9-save/arch/ia64/mm/hugetlbpage.c	2006-04-21 09:58:55.000000000 +0200
+++ linux-2.6.16.9/arch/ia64/mm/hugetlbpage.c	2006-05-05 10:35:14.000000000 +0200
@@ -125,9 +125,9 @@
 
 	addr = htlbpage_to_page(addr);
 	end  = htlbpage_to_page(end);
-	if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE))
+	if (is_hugepage_only_range((*tlb)->mm, floor, HPAGE_SIZE))
 		floor = htlbpage_to_page(floor);
-	if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE))
+	if (is_hugepage_only_range((*tlb)->mm, ceiling, HPAGE_SIZE))
 		ceiling = htlbpage_to_page(ceiling);
 
 	free_pgd_range(tlb, addr, end, floor, ceiling);
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: Small hugetlbpage.c fix
  2006-05-05  8:52 Small hugetlbpage.c fix Zoltan Menyhart
  2006-05-05 16:44 ` Luck, Tony
@ 2006-05-05 18:45 ` Chen, Kenneth W
  2006-05-05 19:06 ` Chen, Kenneth W
  2 siblings, 0 replies; 4+ messages in thread
From: Chen, Kenneth W @ 2006-05-05 18:45 UTC (permalink / raw)
  To: linux-ia64

Zoltan Menyhart wrote on Friday, May 05, 2006 1:53 AM
> --- linux-2.6.16.9-save/arch/ia64/mm/hugetlbpage.c	2006-04-21 09:58:55.000000000 +0200
> +++ linux-2.6.16.9/arch/ia64/mm/hugetlbpage.c	2006-05-05 10:35:14.000000000 +0200
> @@ -125,9 +125,9 @@
>  
>  	addr = htlbpage_to_page(addr);
>  	end  = htlbpage_to_page(end);
> -	if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE))
> +	if (is_hugepage_only_range((*tlb)->mm, floor, HPAGE_SIZE))
>  		floor = htlbpage_to_page(floor);
> -	if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE))
> +	if (is_hugepage_only_range((*tlb)->mm, ceiling, HPAGE_SIZE))
>  		ceiling = htlbpage_to_page(ceiling);
>  
>  	free_pgd_range(tlb, addr, end, floor, ceiling);


Luck, Tony wrote on Friday, May 05, 2006 9:44 AM
> Greg, Chris:
> 
> 2.6.17-rcN has moved on and changed this in other ways, but
> this patch looks like a candidate for the stable series.
> What's there looks like it should kick a warning, if not a
> full blown error from the compiler for getting the type wrong.


What's the big fuss about it?  The first argument is not even used in
is_hugepage_only_range() for ia64.  Plus the fix is a broken fix anyway.

- Ken

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

* RE: Small hugetlbpage.c fix
  2006-05-05  8:52 Small hugetlbpage.c fix Zoltan Menyhart
  2006-05-05 16:44 ` Luck, Tony
  2006-05-05 18:45 ` Chen, Kenneth W
@ 2006-05-05 19:06 ` Chen, Kenneth W
  2 siblings, 0 replies; 4+ messages in thread
From: Chen, Kenneth W @ 2006-05-05 19:06 UTC (permalink / raw)
  To: linux-ia64

Zoltan Menyhart wrote on Friday, May 05, 2006 1:53 AM
> --- linux-2.6.16.9-save/arch/ia64/mm/hugetlbpage.c	2006-04-21 09:58:55.000000000 +0200
> +++ linux-2.6.16.9/arch/ia64/mm/hugetlbpage.c	2006-05-05 10:35:14.000000000 +0200
> @@ -125,9 +125,9 @@
>  
>  	addr = htlbpage_to_page(addr);
>  	end  = htlbpage_to_page(end);
> -	if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE))
> +	if (is_hugepage_only_range((*tlb)->mm, floor, HPAGE_SIZE))
>  		floor = htlbpage_to_page(floor);
> -	if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE))
> +	if (is_hugepage_only_range((*tlb)->mm, ceiling, HPAGE_SIZE))
>  		ceiling = htlbpage_to_page(ceiling);
>  
>  	free_pgd_range(tlb, addr, end, floor, ceiling);


Sorry, I have to nak this one, for multiple reasons:

(1) A proper fix is already in the latest git tree.
(2) usage of is_hugepage_only_range() in function hugetlb_free_pgd_range
    is wrong here.  Because in 2.6.16, is_hugepage_only_range on ia64 is
    defined to be within, where in here the real intent is to scale floor
    and ceiling addresses if they falls into hugetlb virtual address range.
    A proper fix should be:

	-	if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE))
	+	if (REGION_NUMBER(floor) = RGN_HPAGE)
	 		floor = htlbpage_to_page(floor);
	-	if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE))
	+	if (REGION_NUMBER(ceiling) = RGN_HPAGE)
	 		ceiling = htlbpage_to_page(ceiling);

	we get away from this bug because such scenario is not possible on
      ia64 because we have a virtual address hole at the end of each region
      used by the short format vhpt hash address.
(3) lastly, the first argument is not used on ia64.  If the fix is for
    cosmetic reason, that's fine by me.  But I object on the ground of
    correctness for the two reasons given above.

- Ken

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

end of thread, other threads:[~2006-05-05 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-05  8:52 Small hugetlbpage.c fix Zoltan Menyhart
2006-05-05 16:44 ` Luck, Tony
2006-05-05 18:45 ` Chen, Kenneth W
2006-05-05 19:06 ` Chen, Kenneth W

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox