Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751396AbdCHICG (ORCPT ); Wed, 8 Mar 2017 03:02:06 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35967 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750773AbdCHICD (ORCPT ); Wed, 8 Mar 2017 03:02:03 -0500 Date: Wed, 8 Mar 2017 16:00:42 +0800 From: Wei Yang To: Tejun Heo Cc: Wei Yang , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/2] mm/sparse: add last_section_nr in sparse_init() to reduce some iteration cycle Message-ID: <20170308080042.GA18355@WeideMacBook-Pro.local> Reply-To: Wei Yang References: <20170211021829.9646-1-richard.weiyang@gmail.com> <20170211021829.9646-2-richard.weiyang@gmail.com> <20170211022400.GA19050@mtj.duckdns.org> <20170306194225.GB19696@htj.duckdns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <20170306194225.GB19696@htj.duckdns.org> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3310 Lines: 99 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 06, 2017 at 02:42:25PM -0500, Tejun Heo wrote: >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. > Hi, Tejun Thanks for your suggestion. I have tried systemd-analyze to measure the effect, while looks not good. Result without patch ------------------------- Startup finished in 7.243s (kernel) + 25.034s (userspace) =3D 32.277s Startup finished in 7.254s (kernel) + 19.816s (userspace) =3D 27.071s Startup finished in 7.272s (kernel) + 4.363s (userspace) =3D 11.636s Startup finished in 7.258s (kernel) + 24.319s (userspace) =3D 31.577s Startup finished in 7.262s (kernel) + 9.481s (userspace) =3D 16.743s Startup finished in 7.266s (kernel) + 14.766s (userspace) =3D 22.032s Avg =3D 7.259s Result with patch ------------------------- Startup finished in 7.262s (kernel) + 14.294s (userspace) =3D 21.557s Startup finished in 7.264s (kernel) + 19.519s (userspace) =3D 26.783s Startup finished in 7.266s (kernel) + 4.730s (userspace) =3D 11.997s Startup finished in 7.258s (kernel) + 9.514s (userspace) =3D 16.773s Startup finished in 7.258s (kernel) + 14.371s (userspace) =3D 21.629s Startup finished in 7.258s (kernel) + 14.627s (userspace) =3D 21.885s Avg =3D 7.261s It looks the effect is not obvious. Maybe the improvement is not good enough :( >> >> * 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. > Agree. I have replaced the reverse iteration with a simple last pfn return. The te= st result above is based on the new version. >Thanks. > >--=20 >tejun --=20 Wei Yang Help you, Help me --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYv7oqAAoJEKcLNpZP5cTdW0IP/RYXTERjwzLqnqPOGHm8OsHX cqT8+4RLUK70SwOnwLh58BFkssM7V4oq/zaR9mGze3z5er+U+UFdXKRry/x6t5KR GgHDHzxBVaFuFwDZ8mEDhvcJbnH2/AxS2RLsI49tWPgImBeb+bX8LV2X07Dl7U78 tFkttZ3Fa1VZRNyFGTNEPeuB5U+/RaC5Xa+EkXfuraju1icDh2xN3f2M7+/dOSpr ACGLl7Ug3/B6eBQPUh8ll5pJBpaQoYP/efAZ6xLdIPybsPO7tPxDCEvCVHrhg6tO kQVm2nPjOiq4/tpOvRENtdp+VlEdBMSItVlJ651OW2D6Johnl+XIjPzyaAzjgx6Y 0znAbmDBsG+qbuyR7SWt24A095XlXOTaBsxpcMgZnbgEkODcNpqqzQUIsTr0mXj3 XzH2LsTZUMTKmkbIqE393aPeq1yl+w0krQ9gN3pEJRmOU7nGcfqOMH2AErEDkl95 BXFlfEOWaMzDLgs6Uj7r5BVj3TSCduzKmtaQeDhq/pTXA3utD5rq/cuJ6lf8tSkI +U8GhJ3iu44yl09jvG8IrOil2j62ndb2hoapELMlocOhPQvrmcZ7t8lW8eu3HHsi HcPG6Vj3k93Pjmvc5v464TXx8pgKcVDXBkkT8OHWO9p3s3VeDjJ7B0fcXT2D1dwg w08jZLsbelG/ek+CFdfq =FhWU -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--