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

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

 




KAMEZAWA Hiroyuki wrote:
> On Wed, 28 Nov 2007 15:20:42 +0300
> Pavel Emelyanov <xemul@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxxxxx
> https://lists.linux-foundation.org/mailman/listinfo/containers
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux