[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4b2b0132-eb6f-d0a9-e6bb-6b23d3cbcd48@shopee.com>
Date: Tue, 7 Mar 2023 11:20:10 +0800
From: Haifeng Xu <haifeng.xu@...pee.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: David Hildenbrand <david@...hat.com>, akpm@...ux-foundation.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: remove redundant check in handle_mm_fault
On 2023/3/7 10:48, Matthew Wilcox wrote:
> On Tue, Mar 07, 2023 at 10:36:55AM +0800, Haifeng Xu wrote:
>> On 2023/3/6 21:49, David Hildenbrand wrote:
>>> On 06.03.23 03:49, Haifeng Xu wrote:
>>>> mem_cgroup_oom_synchronize() has checked whether current memcg_in_oom is
>>>> set or not, so remove the check in handle_mm_fault().
>>>
>>> "mem_cgroup_oom_synchronize() will returned immediately if memcg_in_oom is not set, so remove the check from handle_mm_fault()".
>>>
>>> However, that requires now always an indirect function call -- do we care about dropping that optimization?
>>>
>>>
>>
>> If memcg_in_oom is set, we will check it twice, one is from handle_mm_fault(), the other is from mem_cgroup_oom_synchronize(). That seems a bit redundant.
>>
>> if memcg_in_oom is not set, mem_cgroup_oom_synchronize() returns directly. Though it's an indirect function call, but the time spent can be negligible
>> compare to the whole mm user falut preocess. And that won't cause stack overflow error.
>
> I suggest you measure it.
Ok, I'll make a simple test.
Powered by blists - more mailing lists