From: Robin Holt <holt@sgi.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Robin Holt <holt@sgi.com>, Greg Kroah-Hartmann <greg@kroah.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: question about link_mem_sections()
Date: Mon, 12 Dec 2011 07:49:37 -0600 [thread overview]
Message-ID: <20111212134937.GE2547@sgi.com> (raw)
In-Reply-To: <CAPXgP10SU77-S9kerb5UwhNB3yAgg_6zAmeLpDpGFTq+yTbY=w@mail.gmail.com>
On Mon, Dec 12, 2011 at 02:11:28PM +0100, Kay Sievers wrote:
> On Mon, Dec 12, 2011 at 13:45, Robin Holt <holt@sgi.com> wrote:
> > On Mon, Dec 12, 2011 at 01:35:50PM +0100, Kay Sievers wrote:
> >> you added find_memory_block_hinted() with:
> >> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=63d027a63888e993545d10fdfe4107d543f01bca
> >>
> >> I try to understand what's going on here, because we need to switch
> >> away from 'struct sysdev'.
> >>
> >> In the loop over the node data you call find_memory_block_hinted() in
> >> a row, which might all take a reference. At the end of the section you
> >> drop only the last reference of the iteration. The code before your
> >> change dropped all references inside the loop.
> >>
> >> Could you please explain the intended behaviour?
> >>
> >> If all is right, we should at least move the now wrong comment where is belongs.
> >
> > Take a look at that commit's parent's parent:
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=c25d1dfbd403209025df41a737f82ce8f43d93f5
> >
> > This adds the kset_find_obj_hinted() function. That function expects
> > the kobject_get to have already been done on the object passed in and
> > will release that reference when it advances to the next object.
> >
> > Within the loop of the link_mem_sections(), we need to retain the
> > kobject_get reference between calls to find_memory_block_hinted() and
> > rely upon that functions call to kset_find_obj_hinted() to release all
> > but the last reference.
> >
> > I hope that explains things. If not, please feel free to ping me again.
>
> Gah, what a twisted logic. That looks more like a pretty specialized
> implementation of an iterator and not a generic kobject 'find'
> function, when it implicitly mangles the hint. :)
>
> Anyway, sounds fine, only the 'dead' and misleading comment in
> link_mem_sections should move out of the loop, right?
Dead comment should go. If you want to rework the logic, that is fine
with me as well. The change did make a huge difference in boot time on
a large memory machine. IIRC, it was something like 30 or 45 minutes
down to .27 seconds or something crazy like that. There were two spots
that needed the speedup.
If you do decide to rework that logic, we can retest for the next couple
months. We do not normally have a 16TB test machine lying around (IIRC,
the memory in something like that costs a couple million dollars), but we
do fortunately have one right now until the latter part of next quarter.
Robin
next prev parent reply other threads:[~2011-12-12 13:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 12:35 question about link_mem_sections() Kay Sievers
2011-12-12 12:45 ` Robin Holt
2011-12-12 13:11 ` Kay Sievers
2011-12-12 13:49 ` Robin Holt [this message]
2011-12-22 1:18 ` Kay Sievers
2011-12-22 9:30 ` Robin Holt
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=20111212134937.GE2547@sgi.com \
--to=holt@sgi.com \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
/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.