For rafter framed or truss framed roof construction, not only is ventilation of these cavities required by the 2009 International Residential Code, but a minimum air flow clearance is required to maintain the path of ventilation. Per the 2009 IRC, Chapter 8, Section 806.3, here is the excerpt for this requirement:
R806.3 Vent and insulation clearance. Where eave or cornice vents are installed, insulation shall not block the free flow of air. A minimum of 1-inch (25 mm) space shall be provided between the insulation and the roof sheathing and at the location of the vent.
Here are a couple more articles related to required attic ventilation, Don’t Make Your Solid Blocking Too Solid – Attic Ventilation Requirements and Typical Rafter Insulation Detail.