Re: [RFC PATCH 2/2] mm/sparse: add last_section_nr in sparse_init() to reduce some iteration cycle

From: Tejun Heo
Date: Mon Mar 06 2017 - 14:46:26 EST


Hello, Wei.

On Fri, Feb 17, 2017 at 10:12:31PM +0800, Wei Yang wrote:
> > And compare the ruling with the iteration for the loop to be (1UL <<
> > 5) and (1UL << 19).
> > The runtime is 0.00s and 0.04s respectively. The absolute value is not much.

systemd-analyze usually does a pretty good job of breaking down which
phase took how long. It might be worthwhile to test whether the
improvement is actually visible during the boot.

> >> * Do we really need to add full reverse iterator to just get the
> >> highest section number?
> >>
> >
> > You are right. After I sent out the mail, I realized just highest pfn
> > is necessary.

That said, getting efficient is always great as long as the added
complexity is justifiably small enough. If you can make the change
simple enough, it'd be a lot easier to merge.

Thanks.

--
tejun