From: "Yang Shi" <yang.s@alibaba-inc.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory
Date: Tue, 10 Oct 2017 02:53:18 +0800 [thread overview]
Message-ID: <2a24ae2a-e2f3-52b2-0763-2ce31ba18965@alibaba-inc.com> (raw)
In-Reply-To: <20171009063642.nykrjazifntrj5zz@dhcp22.suse.cz>
On 10/8/17 11:36 PM, Michal Hocko wrote:
> On Mon 09-10-17 08:33:16, Michal Hocko wrote:
>> On Sat 07-10-17 00:37:55, Yang Shi wrote:
>>>
>>>
>>> On 10/6/17 2:37 AM, Michal Hocko wrote:
>>>> On Thu 05-10-17 05:29:10, Yang Shi wrote:
>> [...]
>>>>> + list_for_each_entry_safe(s, s2, &slab_caches, list) {
>>>>> + if (!is_root_cache(s) || (s->flags & SLAB_RECLAIM_ACCOUNT))
>>>>> + continue;
>>>>> +
>>>>> + memset(&sinfo, 0, sizeof(sinfo));
>>>>
>>>> why do you zero out the structure. All the fields you are printing are
>>>> filled out in get_slabinfo.
>>>
>>> No special reason, just wipe out the potential stale data on the stack.
>>
>> Do not add code that has no meaning. The OOM killer is a slow path but
>> that doesn't mean we should throw spare cycles out of the window.
>
> With this fixed and the compile fix [1] folded, feel free to add my
> Acked-by: Michal Hocko <mhocko@suse.com>
>
> [1] http://lkml.kernel.org/r/1507492085-42264-1-git-send-email-yang.s@alibaba-inc.com
Did some more thorough test and took the code a little deeper, it sounds
!CONFIG_SLOB is not enough. Some data structure and functions depends on
CONFIG_SLUB_DEBUG, i.e. kmem_cache_node->total_objects and
node_nr_objs(), which are essential of get_slabinfo().
So, I'm supposed it makes more sense to protect the related slab stats
code and the unreclaimable slabinfo dump with CONFIG_SLAB ||
CONFIG_SLUB_DEBUG.
Thanks,
Yang
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: "Yang Shi" <yang.s@alibaba-inc.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory
Date: Tue, 10 Oct 2017 02:53:18 +0800 [thread overview]
Message-ID: <2a24ae2a-e2f3-52b2-0763-2ce31ba18965@alibaba-inc.com> (raw)
In-Reply-To: <20171009063642.nykrjazifntrj5zz@dhcp22.suse.cz>
On 10/8/17 11:36 PM, Michal Hocko wrote:
> On Mon 09-10-17 08:33:16, Michal Hocko wrote:
>> On Sat 07-10-17 00:37:55, Yang Shi wrote:
>>>
>>>
>>> On 10/6/17 2:37 AM, Michal Hocko wrote:
>>>> On Thu 05-10-17 05:29:10, Yang Shi wrote:
>> [...]
>>>>> + list_for_each_entry_safe(s, s2, &slab_caches, list) {
>>>>> + if (!is_root_cache(s) || (s->flags & SLAB_RECLAIM_ACCOUNT))
>>>>> + continue;
>>>>> +
>>>>> + memset(&sinfo, 0, sizeof(sinfo));
>>>>
>>>> why do you zero out the structure. All the fields you are printing are
>>>> filled out in get_slabinfo.
>>>
>>> No special reason, just wipe out the potential stale data on the stack.
>>
>> Do not add code that has no meaning. The OOM killer is a slow path but
>> that doesn't mean we should throw spare cycles out of the window.
>
> With this fixed and the compile fix [1] folded, feel free to add my
> Acked-by: Michal Hocko <mhocko@suse.com>
>
> [1] http://lkml.kernel.org/r/1507492085-42264-1-git-send-email-yang.s@alibaba-inc.com
Did some more thorough test and took the code a little deeper, it sounds
!CONFIG_SLOB is not enough. Some data structure and functions depends on
CONFIG_SLUB_DEBUG, i.e. kmem_cache_node->total_objects and
node_nr_objs(), which are essential of get_slabinfo().
So, I'm supposed it makes more sense to protect the related slab stats
code and the unreclaimable slabinfo dump with CONFIG_SLAB ||
CONFIG_SLUB_DEBUG.
Thanks,
Yang
>
next prev parent reply other threads:[~2017-10-09 18:53 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 21:29 [PATCH 0/3 v10] oom: capture unreclaimable slab info in oom message Yang Shi
2017-10-04 21:29 ` Yang Shi
2017-10-04 21:29 ` [PATCH 1/3] tools: slabinfo: add "-U" option to show unreclaimable slabs only Yang Shi
2017-10-04 21:29 ` Yang Shi
2017-10-04 21:29 ` [PATCH 2/3] mm: slabinfo: dump CONFIG_SLABINFO Yang Shi
2017-10-04 21:29 ` Yang Shi
2017-10-07 11:45 ` kbuild test robot
2017-10-07 11:45 ` kbuild test robot
2017-10-07 12:06 ` kbuild test robot
2017-10-07 12:06 ` kbuild test robot
2017-10-04 21:29 ` [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory Yang Shi
2017-10-04 21:29 ` Yang Shi
2017-10-06 9:37 ` Michal Hocko
2017-10-06 9:37 ` Michal Hocko
2017-10-06 16:37 ` Yang Shi
2017-10-06 16:37 ` Yang Shi
2017-10-09 6:33 ` Michal Hocko
2017-10-09 6:33 ` Michal Hocko
2017-10-09 6:36 ` Michal Hocko
2017-10-09 6:36 ` Michal Hocko
2017-10-09 16:44 ` Yang Shi
2017-10-09 16:44 ` Yang Shi
2017-10-09 18:53 ` Yang Shi [this message]
2017-10-09 18:53 ` Yang Shi
2017-10-09 21:00 ` Yang Shi
2017-10-09 21:00 ` Yang Shi
2017-10-07 10:10 ` kbuild test robot
2017-10-07 10:10 ` kbuild test robot
2017-10-07 13:05 ` kbuild test robot
2017-10-07 13:05 ` kbuild test robot
-- strict thread matches above, loose matches on Subject: below --
2017-10-10 17:25 [PATCH 0/3 v11] oom: capture unreclaimable slab info in oom message Yang Shi
2017-10-10 17:25 ` [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory Yang Shi
2017-10-10 17:25 ` Yang Shi
2017-10-17 0:15 ` David Rientjes
2017-10-17 0:15 ` David Rientjes
2017-10-17 7:44 ` Michal Hocko
2017-10-17 7:44 ` Michal Hocko
2017-10-17 20:59 ` David Rientjes
2017-10-17 20:59 ` David Rientjes
2017-10-17 21:40 ` Yang Shi
2017-10-17 21:40 ` Yang Shi
2017-10-17 21:50 ` David Rientjes
2017-10-17 21:50 ` David Rientjes
2017-10-17 22:20 ` Yang Shi
2017-10-17 22:20 ` Yang Shi
2017-10-17 22:39 ` David Rientjes
2017-10-17 22:39 ` David Rientjes
2017-10-18 19:09 ` Yang Shi
2017-10-18 19:09 ` Yang Shi
2017-10-19 7:28 ` Michal Hocko
2017-10-19 7:28 ` Michal Hocko
2017-10-19 23:12 ` Yang Shi
2017-10-19 23:12 ` Yang Shi
2017-10-03 18:06 [PATCH 0/3 v8] oom: capture unreclaimable slab info in oom message Yang Shi
2017-10-03 18:06 ` [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory Yang Shi
2017-10-03 18:06 ` Yang Shi
2017-10-04 14:27 ` Michal Hocko
2017-10-04 14:27 ` Michal Hocko
2017-10-04 17:37 ` Yang Shi
2017-10-04 17:37 ` Yang Shi
2017-10-04 18:08 ` Yang Shi
2017-10-04 18:08 ` Yang Shi
2017-10-05 7:57 ` Michal Hocko
2017-10-05 7:57 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a24ae2a-e2f3-52b2-0763-2ce31ba18965@alibaba-inc.com \
--to=yang.s@alibaba-inc.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.