We examine the gas circulation near a gap opened by a giant planet in a protoplanetary disk. We show with high resolution 3D simulations that the gas flows into the gap at high altitude over the mid-plane, at a rate dependent on viscosity. We explain this observation with a simple conceptual model. From this model we derive an estimate of the amount of gas flowing into a gap opened by a planet with Hill radius comparable to the scale-height of a layered disk (i. e. a disk with viscous upper layer and inviscid midplane). Our estimate agrees with modern MRI simulations(Gressel et al., 2013). We conclude that gap opening in a layered disk can not slow down significantly the runaway gas accretion of Saturn to Jupiter-mass planets.