Re: [PATCH] kanoj-mm17-2.3.21 kswapd vma scanning protection

Linus Torvalds
1999-10-16T00:44:01Z

On Sat, 16 Oct 1999, Manfred Spraul wrote:
>
> What about shm? vma->vm_file is NULL, this would oops.

Well, considering that shm_swapout() currently looks like this:

static int shm_swapout(struct vm_area_struct * vma, struct page * page)
{
return 0;
}

I don't think the SHM case is all that problematic: we could easily just
have a dummy vma->vm_file there. In fact, it probably should do so anyway:
the SHM code _really_ does not need the private member.

There are strong arguments for saying that if the thing you're mapping
actually _needs_ the vma in order to swap out, then the thing is broken.
SHM certainly used to be horribly broken in this area, but that's no
longer true.

Linus