From: David S. Miller Date: Mon, 27 Mar 2006 09:07:55 +0000 (-0800) Subject: [SPARC64]: Fix off-by-1 error in TSB grow check. X-Git-Tag: v2.6.17-rc1~274^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7bebd83dbf096d0bf4b4bfbaf5d8844a05f5eafc;p=linux-2.6-omap-h63xx.git [SPARC64]: Fix off-by-1 error in TSB grow check. The worst part about this bug is what it would cause a hugepage TSB to be allocated for every address space since "0 >= 0". Signed-off-by: David S. Miller --- diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c index d21ff3230c0..0db2f7d9fab 100644 --- a/arch/sparc64/mm/fault.c +++ b/arch/sparc64/mm/fault.c @@ -413,12 +413,12 @@ good_area: #ifdef CONFIG_HUGETLB_PAGE mm_rss -= (mm->context.huge_pte_count * (HPAGE_SIZE / PAGE_SIZE)); #endif - if (unlikely(mm_rss >= + if (unlikely(mm_rss > mm->context.tsb_block[MM_TSB_BASE].tsb_rss_limit)) tsb_grow(mm, MM_TSB_BASE, mm_rss); #ifdef CONFIG_HUGETLB_PAGE mm_rss = mm->context.huge_pte_count; - if (unlikely(mm_rss >= + if (unlikely(mm_rss > mm->context.tsb_block[MM_TSB_HUGE].tsb_rss_limit)) tsb_grow(mm, MM_TSB_HUGE, mm_rss); #endif