Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932896AbdCFTqY (ORCPT ); Mon, 6 Mar 2017 14:46:24 -0500 Received: from mail-yw0-f169.google.com ([209.85.161.169]:33563 "EHLO mail-yw0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932595AbdCFTme (ORCPT ); Mon, 6 Mar 2017 14:42:34 -0500 Date: Mon, 6 Mar 2017 14:42:25 -0500 From: Tejun Heo To: Wei Yang Cc: 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: <20170306194225.GB19696@htj.duckdns.org> References: <20170211021829.9646-1-richard.weiyang@gmail.com> <20170211021829.9646-2-richard.weiyang@gmail.com> <20170211022400.GA19050@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 838 Lines: 26 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