On Tue, Feb 03, 2015 at 02:23:23PM -0500, Benjamin LaHaise wrote: > On Tue, Feb 03, 2015 at 11:18:53AM -0800, Shaohua Li wrote: > > mremap aio ring buffer to another smaller vma is legal. For example, > > mremap the ring buffer from the begining, though after the mremap, some > > ring buffer pages can't be accessed in userspace because vma size is > > shrinked. The problem is ctx->mmap_size isn't changed if the new ring > > buffer vma size is changed. Latter io_destroy will zap all vmas within > > mmap_size, which might zap unrelated vmas. > > Nak. Shrinking the aio ring buffer is not a supported operation and will > cause the application to lose events. Make the size changing mremap fail, > as this patch will not make the system do the right thing. Yes, making the syscall fail (vma ops has .remap) is another option. If the app uses io_getevents(), looks the app will not lose events, no? On the other hand, I just want to make sure kernel does the right thing (not zap unrelated vmas). If app does crazy things, it will break. Thanks, Shaohua -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>