Re: [PATCH 3/3] mlock: avoid dirtying pages and triggering writeback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 19, 2010 at 08:42:05AM -0500, Theodore Tso wrote:
> My vote would be against. ? If you if you mmap a sparse file and then
> try writing to it willy-nilly, bad things will happen. ?This is true without
> a mlock(). ? Where is it written that mlock() has anything to do with
> improving this situation?

Exactly.  Allocating space has been a side-effect on a handfull
filesystem for about 20 kernel releases.

> If userspace wants to call fallocate() before it calls mlock(), it should
> do that. ?And in fact, in most cases, userspace should probably be
> encouraged to do that. ? But having mlock() call fallocate() and
> then return ENOSPC if there's no room?  Isn't it confusing that mlock()
> call ENOSPC?  Doesn't that give you cognitive dissonance?  It should
> because fundamentally mlock() has nothing to do with block allocation!!
> Read the API spec!

Indeed.  There is no need to make mlock + flag a parallel-API to
fallocate.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]