Home » Mailing lists » Devel » [PATCH v5 00/14] kmem controller for memcg.
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure [message #48515 is a reply to message #48502] |
Fri, 19 October 2012 10:08   |
Glauber Costa
Messages: 916 Registered: October 2011
|
Senior Member |
|
|
On 10/19/2012 01:59 AM, David Rientjes wrote:
> On Thu, 18 Oct 2012, Glauber Costa wrote:
>
>>>> @@ -2630,6 +2634,171 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,
>>>> memcg_check_events(memcg, page);
>>>> }
>>>>
>>>> +#ifdef CONFIG_MEMCG_KMEM
>>>> +static inline bool memcg_can_account_kmem(struct mem_cgroup *memcg)
>>>> +{
>>>> + return !mem_cgroup_disabled() && !mem_cgroup_is_root(memcg) &&
>>>> + (memcg->kmem_accounted & KMEM_ACCOUNTED_MASK);
>>>> +}
>>>> +
>>>> +static int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp, u64 size)
>>>> +{
>>>> + struct res_counter *fail_res;
>>>> + struct mem_cgroup *_memcg;
>>>> + int ret = 0;
>>>> + bool may_oom;
>>>> +
>>>> + ret = res_counter_charge(&memcg->kmem, size, &fail_res);
>>>> + if (ret)
>>>> + return ret;
>>>> +
>>>> + /*
>>>> + * Conditions under which we can wait for the oom_killer.
>>>> + * We have to be able to wait, but also, if we can't retry,
>>>> + * we obviously shouldn't go mess with oom.
>>>> + */
>>>> + may_oom = (gfp & __GFP_WAIT) && !(gfp & __GFP_NORETRY);
>>>
>>> What about gfp & __GFP_FS?
>>>
>>
>> Do you intend to prevent or allow OOM under that flag? I personally
>> think that anything that accepts to be OOM-killed should have GFP_WAIT
>> set, so that ought to be enough.
>>
>
> The oom killer in the page allocator cannot trigger without __GFP_FS
> because direct reclaim has little chance of being very successful and
> thus we end up needlessly killing processes, and that tends to happen
> quite a bit if we dont check for it. Seems like this would also happen
> with memcg if mem_cgroup_reclaim() has a large probability of failing?
>
I can indeed see tests for GFP_FS in some key locations in mm/ before
calling the OOM Killer.
Should I test for GFP_IO as well? If the idea is preventing OOM to
trigger for allocations that can write their pages back, how would you
feel about the following test:
may_oom = (gfp & GFP_KERNEL) && !(gfp & __GFP_NORETRY) ?
Michal, what is your take in here?
|
|
|
 |
|
[PATCH v5 00/14] kmem controller for memcg.
|
 |
|
[PATCH v5 03/14] memcg: change defines to an enum
|
 |
|
Re: [PATCH v5 03/14] memcg: change defines to an enum
|
 |
|
[PATCH v5 01/14] memcg: Make it possible to use the stock for more than one page.
|
 |
|
Re: [PATCH v5 01/14] memcg: Make it possible to use the stock for more than one page.
By: akpm on Wed, 17 October 2012 22:11
|
 |
|
Re: [PATCH v5 01/14] memcg: Make it possible to use the stock for more than one page.
|
 |
|
[PATCH v5 04/14] kmem accounting basic infrastructure
|
 |
|
Re: [PATCH v5 04/14] kmem accounting basic infrastructure
|
 |
|
Re: [PATCH v5 04/14] kmem accounting basic infrastructure
|
 |
|
Re: [PATCH v5 04/14] kmem accounting basic infrastructure
|
 |
|
Re: [PATCH v5 04/14] kmem accounting basic infrastructure
|
 |
|
Re: [PATCH v5 04/14] kmem accounting basic infrastructure
|
 |
|
Re: [PATCH v5 04/14] kmem accounting basic infrastructure
By: akpm on Wed, 17 October 2012 22:12
|
 |
|
Re: [PATCH v5 04/14] kmem accounting basic infrastructure
|
 |
|
[PATCH v5 11/14] memcg: allow a memcg with kmem charges to be destructed.
|
 |
|
Re: [PATCH v5 11/14] memcg: allow a memcg with kmem charges to be destructed.
By: akpm on Wed, 17 October 2012 22:12
|
 |
|
Re: [PATCH v5 11/14] memcg: allow a memcg with kmem charges to be destructed.
|
 |
|
[PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
By: akpm on Wed, 17 October 2012 22:12
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
Re: [PATCH v5 06/14] memcg: kmem controller infrastructure
|
 |
|
[PATCH v5 05/14] Add a __GFP_KMEMCG flag
|
 |
|
Re: [PATCH v5 05/14] Add a __GFP_KMEMCG flag
|
 |
|
Re: [PATCH v5 05/14] Add a __GFP_KMEMCG flag
|
 |
|
[PATCH v5 09/14] memcg: kmem accounting lifecycle management
|
 |
|
Re: [PATCH v5 09/14] memcg: kmem accounting lifecycle management
|
 |
|
Re: [PATCH v5 09/14] memcg: kmem accounting lifecycle management
|
 |
|
Re: [PATCH v5 09/14] memcg: kmem accounting lifecycle management
|
 |
|
[PATCH v5 10/14] memcg: use static branches when code not in use
|
 |
|
[PATCH v5 14/14] Add documentation about the kmem controller
|
 |
|
Re: [PATCH v5 14/14] Add documentation about the kmem controller
|
 |
|
Re: [PATCH v5 14/14] Add documentation about the kmem controller
|
 |
|
Re: [PATCH v5 14/14] Add documentation about the kmem controller
|
 |
|
Re: [PATCH v5 14/14] Add documentation about the kmem controller
|
 |
|
Re: [PATCH v5 14/14] Add documentation about the kmem controller
By: akpm on Wed, 17 October 2012 22:12
|
 |
|
Re: [PATCH v5 14/14] Add documentation about the kmem controller
|
 |
|
[PATCH v5 13/14] protect architectures where THREAD_SIZE >= PAGE_SIZE against fork bombs
|
 |
|
Re: [PATCH v5 13/14] protect architectures where THREAD_SIZE >= PAGE_SIZE against fork bombs
By: akpm on Wed, 17 October 2012 22:12
|
 |
|
Re: [PATCH v5 13/14] protect architectures where THREAD_SIZE >= PAGE_SIZE against fork bombs
|
 |
|
[PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
|
 |
|
Re: [PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
|
 |
|
Re: [PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
|
 |
|
Re: [PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
By: akpm on Wed, 17 October 2012 22:12
|
 |
|
Re: [PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
|
 |
|
Re: [PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
By: akpm on Thu, 18 October 2012 20:44
|
 |
|
Re: [PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
|
 |
|
Re: [PATCH v5 07/14] mm: Allocate kernel pages to the right memcg
|
 |
|
Re: [PATCH v5 00/14] kmem controller for memcg.
By: akpm on Wed, 17 October 2012 22:11
|
 |
|
Re: [PATCH v5 00/14] kmem controller for memcg.
|
 |
|
Re: [PATCH v5 00/14] kmem controller for memcg.
By: akpm on Thu, 18 October 2012 19:21
|
 |
|
Re: [PATCH v5 00/14] kmem controller for memcg.
|
Goto Forum:
Current Time: Mon Aug 25 12:01:54 GMT 2025
Total time taken to generate the page: 0.06619 seconds
|