From: Yang Shi <yang.shi@linux.alibaba.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: longman@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4 v6] lib: debugobjects: add global free list and the counter
Date: Mon, 12 Feb 2018 10:53:24 -0800 [thread overview]
Message-ID: <0ba82b3c-367e-29d3-59ee-6d85ce10037a@linux.alibaba.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1802121654350.1158@nanos.tec.linutronix.de>
On 2/12/18 7:54 AM, Thomas Gleixner wrote:
> On Mon, 12 Feb 2018, Thomas Gleixner wrote:
>> On Tue, 6 Feb 2018, Yang Shi wrote:
>>> + /*
>>> + * The objs on the pool list might be allocated before the work is
>>> + * run, so recheck if pool list it full or not, if not fill pool
>>> + * list from the global free list
>>> + */
>>> + while (obj_pool_free < debug_objects_pool_size) {
>>> + if (obj_nr_tofree <= 0)
>>> + break;
>>> +
>>> + obj = hlist_entry(obj_to_free.first, typeof(*obj), node);
>>> + hlist_del(&obj->node);
>>> + hlist_add_head(&obj->node, &obj_pool);
>>> + obj_pool_free++;
>>> + obj_nr_tofree--;
>>> + }
>>> +
>>> + /*
>>> + * pool list is already full, and there are still objs on the free list,
>>> + * move remaining free objs to a separate list to free the memory later.
>>> + */
>>> + if (obj_nr_tofree > 0) {
>>> + hlist_move_list(&obj_to_free, &tofree);
>>> + obj_nr_tofree = 0;
>>> + }
>>> +
>>> while (obj_pool_free >= debug_objects_pool_size + ODEBUG_FREE_BATCH) {
>>> for (i = 0; i < ODEBUG_FREE_BATCH; i++) {
>>> objs[i] = hlist_entry(obj_pool.first,
>> This whole section is now pointless and can be removed. There is no way
>> that this code path can be entered after this change. Surplus objects are
>> on the obj_to_free list and not on the obj_pool itself.
Yes, it is correct. I think the whole ODEBUG_FREE_BATCH thing can be
removed too.
Will do it in the next version.
Regards,
Yang
> Actually not in this patch, but in the next one.
>
> Thanks,
>
> tglx
next prev parent reply other threads:[~2018-02-12 18:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 23:18 [PATCH 0/4 v6] lib: debugobjects: Introduce new global free list and defer objects free via the free list Yang Shi
2018-02-05 23:18 ` [PATCH 1/4 v6] lib: debugobjects: export max loops counter Yang Shi
2018-02-12 15:04 ` Thomas Gleixner
2018-02-13 10:03 ` [tip:core/debugobjects] debugobjects: Export " tip-bot for Yang Shi
2018-02-05 23:18 ` [PATCH 2/4 v6] lib: debugobjects: add global free list and the counter Yang Shi
2018-02-12 15:52 ` Thomas Gleixner
2018-02-12 15:54 ` Thomas Gleixner
2018-02-12 18:53 ` Yang Shi [this message]
2018-02-12 16:25 ` Thomas Gleixner
2018-02-12 18:48 ` Yang Shi
2018-02-13 10:02 ` Thomas Gleixner
2018-02-14 5:33 ` Yang Shi
2018-02-13 10:04 ` [tip:core/debugobjects] debugobjects: Add " tip-bot for Yang Shi
2018-02-05 23:18 ` [PATCH 3/4 v6] lib: debugobjects: use global free list in free_object() Yang Shi
2018-02-13 10:04 ` [tip:core/debugobjects] debugobjects: Use " tip-bot for Yang Shi
2018-02-05 23:18 ` [PATCH 4/4 v6] lib: debugobjects: handle objects free in a batch outside the loop Yang Shi
2018-02-13 10:05 ` [tip:core/debugobjects] debugobjects: Use global free list in __debug_check_no_obj_freed() tip-bot for Yang Shi
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=0ba82b3c-367e-29d3-59ee-6d85ce10037a@linux.alibaba.com \
--to=yang.shi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome