On Tue 11-07-17 11:23:19, Mike Kravetz wrote: > On 07/11/2017 05:36 AM, Michal Hocko wrote: [...] > > Anyway the patch should fail with -EINVAL on private mappings as Kirill > > already pointed out > > Yes. I think this should be a separate patch. As mentioned earlier, > mremap today creates a new/additional private mapping if called in this > way with old_size == 0. To me, this is a bug. Not only that. It clears existing ptes in the old mapping so the content is lost. That is quite unexpected behavior. Now it is hard to assume whether somebody relies on the behavior (I can easily imagine somebody doing backup&clear in atomic way) so failing with EINVAL might break userspace so I am not longer sure. Anyway this really needs to be documented. -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html