Hello, On Thu, Nov 20, 2014 at 12:50:36AM +0100, Frederic Weisbecker wrote: > > Are we talking about different per cpu allocators here or am I missing > > something completely non obvious? > > That's the same allocator yeah. So if the whole memory is dereferenced, > faults shouldn't happen indeed. > > Maybe that was a bug a few years ago but not anymore.
It has been always like that tho. Percpu memory given out is always populated and cleared. > Is it possible that, somehow, some part isn't zeroed by pcpu_alloc()? > After all it's allocated with vzalloc() so that part could be skipped. The > memset(0) The vzalloc call is for the internal allocation bitmap not the actual percpu memory area. The actual address areas for percpu memory are obtained using pcpu_get_vm_areas() call and later get populated using map_kernel_range_noflush() (flush is performed after mapping is complete). Trying to remember what happens with vmalloc_fault(). Ah okay, so when a new PUD gets created for vmalloc area, we don't go through all PGDs and update them. The PGD entries get faulted in lazily. Percpu memory allocator clearing or not clearing the allocated area doesn't have anything to do with it. The memory area is always fully populated in the kernel page table. It's just that the population happened while a different PGD was active and this PGD hasn't been populated with the new PUD yet. So, yeap, vmalloc_fault() can always happen when accessing vmalloc areas and the only way to avoid that would be removing lazy PGD population - going through all PGDs and populating new PUDs immediately. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/