All of lore.kernel.org
 help / color / mirror / Atom feed
* re: mm: memory-hotplug: enable memory hotplug to handle hugepage
@ 2015-05-11 11:17 Dan Carpenter
  2015-05-11 11:29 ` Dan Carpenter
  2015-05-11 23:54 ` Naoya Horiguchi
  0 siblings, 2 replies; 13+ messages in thread
From: Dan Carpenter @ 2015-05-11 11:17 UTC (permalink / raw)
  To: n-horiguchi; +Cc: linux-mm

Hello Naoya Horiguchi,

The patch c8721bbbdd36: "mm: memory-hotplug: enable memory hotplug to
handle hugepage" from Sep 11, 2013, leads to the following static
checker warning:

	mm/hugetlb.c:1203 dissolve_free_huge_pages()
	warn: potential right shift more than type allows '9,18,64'

mm/hugetlb.c
  1189  void dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn)
  1190  {
  1191          unsigned int order = 8 * sizeof(void *);
                                     ^^^^^^^^^^^^^^^^^^
Let's say order is 64.

  1192          unsigned long pfn;
  1193          struct hstate *h;
  1194  
  1195          if (!hugepages_supported())
  1196                  return;
  1197  
  1198          /* Set scan step to minimum hugepage size */
  1199          for_each_hstate(h)
  1200                  if (order > huge_page_order(h))
  1201                          order = huge_page_order(h);
  1202          VM_BUG_ON(!IS_ALIGNED(start_pfn, 1 << order));
  1203          for (pfn = start_pfn; pfn < end_pfn; pfn += 1 << order)
                                                            ^^^^^^^^^^
1 << 64 is undefined but let's say it's zero because that's normal for
GCC.  This is an endless loop.

  1204                  dissolve_free_huge_page(pfn_to_page(pfn));
  1205  }

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2015-05-14  6:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 11:17 mm: memory-hotplug: enable memory hotplug to handle hugepage Dan Carpenter
2015-05-11 11:29 ` Dan Carpenter
2015-05-11 23:56   ` Naoya Horiguchi
2015-05-11 23:54 ` Naoya Horiguchi
2015-05-12  8:43   ` Dan Carpenter
2015-05-12  9:04     ` Naoya Horiguchi
2015-05-12  9:13       ` Dan Carpenter
2015-05-12  9:16         ` Naoya Horiguchi
2015-05-12  9:20           ` [PATCH] mm/hugetlb: initialize order with UINT_MAX in dissolve_free_huge_pages() Naoya Horiguchi
2015-05-12 23:15             ` Andrew Morton
2015-05-13  1:44               ` Naoya Horiguchi
2015-05-13 20:55                 ` Andrew Morton
2015-05-14  6:15                   ` [PATCH] mm/hugetlb: introduce minimum hugepage order Naoya Horiguchi

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.