Re: [PATCH] NR_RESERVED_FILES broken in 2.4 too

From: Tigran Aivazian (tigran@veritas.com)
Date: Sun Dec 10 2000 - 16:12:45 EST


On Sun, 10 Dec 2000, Szabolcs Szakacsits wrote:
> Or 0 shouldn't be between 0 and NR_RESERVED_FILES. Right? Wrong. I saw
> it happens, you can reproduce it if you lookup the nr_free_files
> value, allocate that much by root, don't release them and
> immediately after this start to allocate fd's by user app.

Ok, let's slowly understand each other. The scenario you suggest is:

a) measure nr_free_files and let root exhaust all freelist entries. Now
the freelist is empty and nr_free_files = 0.

b) now let the user app allocate (from the slab cache) lots of new file
structures. He can keep doing so until nr_files hits max_files.

Now what? Now root tries to allocate some and obviously he can't because
the freelist is empty. So what? Where is the bug? This is an expected
behaviour to me -- since the freelist is empty there are no more reserved
file structures for root. Which part of this do you believe is wrong? Or
do you believe that this is not the case at all? I.e. something else
happens in the above scenario which I am still missing? If so, please
explain.

If, however, you believe that the above _is_ the case but it should _not_
happen then you are proposing a completely new policy of file structure
allocation which you believe is superior. It is quite possible so let's
all understand your new policy and let Linus decide whether it's better
than the existing one. But if so, don't tell me you are fixing a bug
because it is not a bug -- it's a redesign of file structure allocator.

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Dec 15 2000 - 21:00:20 EST