From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FFACC43381 for ; Tue, 26 Mar 2019 22:57:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0798E2173C for ; Tue, 26 Mar 2019 22:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732348AbfCZW5U (ORCPT ); Tue, 26 Mar 2019 18:57:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56872 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727422AbfCZW5U (ORCPT ); Tue, 26 Mar 2019 18:57:20 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 015B830FE5B3; Tue, 26 Mar 2019 22:57:20 +0000 (UTC) Received: from localhost (ovpn-12-27.pek2.redhat.com [10.72.12.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59F4519C7B; Tue, 26 Mar 2019 22:57:19 +0000 (UTC) Date: Wed, 27 Mar 2019 06:57:16 +0800 From: Baoquan He To: Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, rppt@linux.ibm.com, osalvador@suse.de, willy@infradead.org, william.kucharski@oracle.com Subject: Re: [PATCH v2 2/4] mm/sparse: Optimize sparse_add_one_section() Message-ID: <20190326225716.GY3659@MiWiFi-R3L-srv> References: <20190326090227.3059-1-bhe@redhat.com> <20190326090227.3059-3-bhe@redhat.com> <20190326092936.GK28406@dhcp22.suse.cz> <20190326100817.GV3659@MiWiFi-R3L-srv> <20190326101710.GN28406@dhcp22.suse.cz> <20190326134522.GB21943@MiWiFi-R3L-srv> <20190326140348.GQ28406@dhcp22.suse.cz> <20190326141803.GX3659@MiWiFi-R3L-srv> <20190326143145.GR28406@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190326143145.GR28406@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 26 Mar 2019 22:57:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, On 03/26/19 at 03:31pm, Michal Hocko wrote: > > > > OK, I am fine to drop it. Or only put the section existence checking > > > > earlier to avoid unnecessary usemap/memmap allocation? > > > > > > DO you have any data on how often that happens? Should basically never > > > happening, right? > > > > Oh, you think about it in this aspect. Yes, it rarely happens. > > Always allocating firstly can increase efficiency. Then I will just drop > > it. > > OK, let me try once more. Doing a check early is something that makes > sense in general. Another question is whether the check is needed at > all. So rather than fiddling with its placement I would go whether it is > actually failing at all. I suspect it doesn't because the memory hotplug > is currently enforced to be section aligned. There are people who would > like to allow subsection or section unaligned aware hotplug and then > this would be much more relevant but without any solid justification > such a patch is not really helpful because it might cause code conflicts > with other work or obscure the git blame tracking by an additional hop. > > In short, if you want to optimize something then make sure you describe > what you are optimizing how it helps. I must be dizzy last night when thinking and replying mails, I thought about it a while, got a point you may mean. Now when I check mail and rethink about it, that reply may make misunderstanding. It doesn't actually makes sense to optimize, just a little code block moving. I now agree with you that it doesn't optimize anything and may impact people's code change. Sorry about that. Thanks Baoquan