Title: [103026] trunk/Tools
- Revision
- 103026
- Author
- e...@webkit.org
- Date
- 2011-12-15 22:02:55 -0800 (Thu, 15 Dec 2011)
Log Message
NRWT should use free + inactive memory for default_child_processes on OS X (and never return < 1 process)
https://bugs.webkit.org/show_bug.cgi?id=74650
Reviewed by Adam Barth.
* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo._compute_bytes_from_vm_stat_output):
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.default_child_processes):
* Scripts/webkitpy/layout_tests/port/base_unittest.py:
(PortTest.test_default_child_processes):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (103025 => 103026)
--- trunk/Tools/ChangeLog 2011-12-16 06:00:00 UTC (rev 103025)
+++ trunk/Tools/ChangeLog 2011-12-16 06:02:55 UTC (rev 103026)
@@ -1,3 +1,17 @@
+2011-12-15 Eric Seidel <e...@webkit.org>
+
+ NRWT should use free + inactive memory for default_child_processes on OS X (and never return < 1 process)
+ https://bugs.webkit.org/show_bug.cgi?id=74650
+
+ Reviewed by Adam Barth.
+
+ * Scripts/webkitpy/common/system/platforminfo.py:
+ (PlatformInfo._compute_bytes_from_vm_stat_output):
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.default_child_processes):
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ (PortTest.test_default_child_processes):
+
2011-12-15 Filip Pizlo <fpi...@apple.com>
bencher script should support remote benchmarking on platforms that don't have ruby
Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py (103025 => 103026)
--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py 2011-12-16 06:00:00 UTC (rev 103025)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py 2011-12-16 06:02:55 UTC (rev 103026)
@@ -51,9 +51,9 @@
return int(self._executive.run_command(["sysctl", "-n", "hw.memsize"]))
return None
- def _compute_free_bytes_from_vm_stat_output(self, vm_stat_output):
+ def _compute_bytes_from_vm_stat_output(self, label_text, vm_stat_output):
page_size_match = re.search(r"page size of (\d+) bytes", vm_stat_output)
- free_pages_match = re.search(r"Pages free:\s+(\d+).", vm_stat_output)
+ free_pages_match = re.search(r"%s:\s+(\d+)." % label_text, vm_stat_output)
if not page_size_match or not free_pages_match:
return None
free_page_count = int(free_pages_match.group(1))
@@ -64,5 +64,8 @@
system_name = platform.system()
if system_name == "Darwin":
vm_stat_output = self._executive.run_command(["vm_stat"])
- return self._compute_free_bytes_from_vm_stat_output(vm_stat_output)
+ free_bytes = self._compute_bytes_from_vm_stat_output("Pages free", vm_stat_output)
+ # Per https://bugs.webkit.org/show_bug.cgi?id=74650 include inactive memory since the OS is lazy about freeing memory.
+ free_bytes += self._compute_bytes_from_vm_stat_output("Pages inactive", vm_stat_output)
+ return free_bytes
return None
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (103025 => 103026)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2011-12-16 06:00:00 UTC (rev 103025)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2011-12-16 06:02:55 UTC (rev 103026)
@@ -169,7 +169,7 @@
free_memory = self.host.platform.free_bytes_memory()
if free_memory:
bytes_per_drt = 200 * 1024 * 1024 # Assume each DRT needs 200MB to run.
- supportable_instances = free_memory / bytes_per_drt
+ supportable_instances = max(free_memory / bytes_per_drt, 1) # Always use one process, even if we don't have space for it.
if supportable_instances < cpu_count:
# FIXME: The Printer isn't initialized when this is called, so using _log would just show an unitialized logger error.
print "This machine could support %s child processes, but only has enough memory for %s." % (cpu_count, supportable_instances)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py (103025 => 103026)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2011-12-16 06:00:00 UTC (rev 103025)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2011-12-16 06:02:55 UTC (rev 103026)
@@ -65,10 +65,11 @@
child_processes = OutputCapture().assert_outputs(self, port.default_child_processes, (), expected_stdout=expected_stdout)
self.assertEqual(child_processes, 1)
+ # Make sure that we always use one process, even if we don't have the memory for it.
port.host.platform.free_bytes_memory = lambda: bytes_for_drt - 1
- expected_stdout = "This machine could support 2 child processes, but only has enough memory for 0.\n"
+ expected_stdout = "This machine could support 2 child processes, but only has enough memory for 1.\n"
child_processes = OutputCapture().assert_outputs(self, port.default_child_processes, (), expected_stdout=expected_stdout)
- self.assertEqual(child_processes, 0)
+ self.assertEqual(child_processes, 1)
def test_format_wdiff_output_as_html(self):
output = "OUTPUT %s %s %s" % (Port._WDIFF_DEL, Port._WDIFF_ADD, Port._WDIFF_END)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes