[RFC][ only for review ] memory controller bacground reclaim [4/5] high/low watermark for memory controller

Oren Laadan orenl at cs.columbia.edu
Thu Nov 29 11:55:56 PST 2007



KAMEZAWA Hiroyuki wrote:
> On Wed, 28 Nov 2007 15:20:42 +0300
> Pavel Emelyanov <xemul at openvz.org> wrote:
>>> +	mem = mem_cgroup_from_cont(cont);
>>> +	spin_lock_irqsave(&mem->res.lock, flags);
>>> +	val = res_counter_get(&mem->res, RES_LIMIT);
>>> +	if (val == (unsigned long long) LLONG_MAX) {
>>> +		low = (unsigned long long) LLONG_MAX;
>>> +		high = (unsigned long long) LLONG_MAX;
>>> +	} else {
>>> +		low = val * DEFAULT_WATERMARK_PERCENT_LOW / 100ULL;
>>> +		high = val * DEFAULT_WATERMARK_PERCENT_HIGH / 100ULL;
>> BTW, I tried to compile such a code:
>>
>> unsigned long long x, y;
>> y = ...;
>> x = y / 100ULL;
>>
>> (similar to yours) and that's what I got:
>>
>> kernel/built-in.o: In function `xxx':
>> : undefined reference to `__udivdi3'
>>
>> It looks like i386 doesn't have any support for ULL divisions.
>> It doesn't have it in CPU, and I thought that it was some-how 
>> emulated, but it is not...
>>
>> Did I miss something?
>>
> Ah, I didn't try i386...
> But I'll drop this automatic watermark adjustment part.

FYI, if you do need it, you can do long long division on i386 using
the macro "do_div()", defined in "include/asm-i386/div64.h".

Oren.

> Thanks,
> -Kame
> 
> _______________________________________________
> Containers mailing list
> Containers at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containers


More information about the Containers mailing list