Re: [patch] mlock-as-nonroot revisted

From: Chris Wright
Date: Tue Aug 03 2004 - 17:34:52 EST


* Andrea Arcangeli (andrea@xxxxxxx) wrote:
> On Tue, Aug 03, 2004 at 03:01:18PM -0700, Chris Wright wrote:
> > I'm not sure what you mean. Truncate should only update the accounting,
> > not break the binding, right?
>
> yep, update the accounting. And with that I meant "releasing" part of
> it (accordingly to the size of the truncate, a truncate(0) should
> release it all).

OK, good. I thought you meant drop binding to user, rather then reduce
the accounting.

> > It's meant to be done at object destruction.
>
> where?

I just mean in general the only time it's valid to drop the binding
(which includes dropping refcount on the user struct) should be when
the object is destroyed.

> Maybe it's just that those are incremental patches and I'm missing the
> other part of the patch, but reading those patches I can't see where the
> user_subtract_mlock happens when I truncate an hugetlbfs file (or delete
> it or whatever). Sure it can't be munlock releasing/_updating_ the user-struct
> accounting for fs persistent storage. But if other code takes care of it
> then maybe you want to delete the user_subtract_mlock function and use
> the other piece that already existed for truncate.

Heh, yeah in a place like hugetlb_put_quota?

> Anyways my overall picture of this is that you're trying to do
> filesystem quotas with rlimit which sounds quite flawed.

It's so tempting because of the similarity (and hence ease of
administration) with mlocked pages. And if they can be merged,
user_struct being a fine placeholder, then it's perhaps simpler.

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/