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=-12.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 BBBDAC11F68 for ; Fri, 2 Jul 2021 17:55:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DB426140E for ; Fri, 2 Jul 2021 17:55:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbhGBR6F (ORCPT ); Fri, 2 Jul 2021 13:58:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56725 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbhGBR6E (ORCPT ); Fri, 2 Jul 2021 13:58:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625248532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EBypdu+ASMiZiDbLrZB83GDc3oCus4O2i/SIdEpUxXA=; b=NIHxMa6A6CKul3RTlZvwzh28U57FbhlGIVhNfdefnBrUU1BPNpcS4hLl/EqbCmlDCD8th1 rgOoeNmGp22kc4V5rpMHWLyQXUrHJIvbLINn+A9wK+KulCUBgp3OJ5hKxwWxlpQ/QYCTVZ xDkUzOmSTMMHVlD0H+V9/TjMnd2gVBE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-Znuagvu6MRODu8Kvx67Bcw-1; Fri, 02 Jul 2021 13:55:31 -0400 X-MC-Unique: Znuagvu6MRODu8Kvx67Bcw-1 Received: by mail-wr1-f70.google.com with SMTP id a4-20020adffb840000b02901304c660e75so1009930wrr.19 for ; Fri, 02 Jul 2021 10:55:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=EBypdu+ASMiZiDbLrZB83GDc3oCus4O2i/SIdEpUxXA=; b=jVwIw6jQFjF/U1iIP4CPi4Dk7qENVqCw7lbIR2f6vTOk8DeKvMTlai6BTN13gz42fz 0vxgPU77857e4glhl2eC2gbcpaaaFZCgouL3OJsf0Twpez1ozAjz+fL+t+hW32S43Xm/ s3MohsVu/uNbrEErTWxNzuGcs9loNtYVO2J9jCjp5h3nEIBsZ3qvA0lqiAUOTcjQs9vk 7XIPh2A38bYeVHz+XgQSJpzbq5ked+i1lvFAMV4R6veEnTPZP28+naRsl2Uysh0H+AWJ al/20uMjCQ4xVYUgR/fNCRndnG++f4PkSjnANUY4BtXFWCKpATS8NQj5yl8AaWG+A5wU wFTA== X-Gm-Message-State: AOAM532YNa9GmbPps1+wp4AIoxbYoKVG/oNFKaAVqpxTiJypnjGgTuNF AY9f3p2d9363bgUY9uE8lAKsMyUZ06kP6txCyQQpfI3MNYG7NBHZIkF78q00EwxB1GZjyu5ITtG 97k5ZBKhMGuvL+OT6jOBk+RhyqsLGAu+vHysgFkQxzs+lak19afreo1+NrN/TQB990Qo3pD3z X-Received: by 2002:a05:600c:4410:: with SMTP id u16mr708291wmn.143.1625248530020; Fri, 02 Jul 2021 10:55:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMXij4I0fjYvaniP3PS/apVcy+HgCgGmz62kIk3I3D3H5cGZi8XI5jal+6y8jN/bDf70Bn1w== X-Received: by 2002:a05:600c:4410:: with SMTP id u16mr708268wmn.143.1625248529728; Fri, 02 Jul 2021 10:55:29 -0700 (PDT) Received: from [192.168.3.132] (p4ff23afb.dip0.t-ipconnect.de. [79.242.58.251]) by smtp.gmail.com with ESMTPSA id w22sm13430546wmc.4.2021.07.02.10.55.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 10:55:29 -0700 (PDT) Subject: Re: [PATCH 2/3] mm: sparse: pass section_nr to find_memory_block To: Ohhoon Kwon , akpm@linux-foundation.org, mhocko@suse.com Cc: bhe@redhat.com, rppt@linux.ibm.com, ohkwon1043@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210702094132.6276-1-ohoono.kwon@samsung.com> <20210702094132.6276-3-ohoono.kwon@samsung.com> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Fri, 2 Jul 2021 19:55:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210702094132.6276-3-ohoono.kwon@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.07.21 11:41, Ohhoon Kwon wrote: > With CONFIG_SPARSEMEM_EXTREME enabled, __section_nr() which converts > mem_section to section_nr could be costly since it iterates all > section roots to check if the given mem_section is in its range. > > On the other hand, __nr_to_section() which converts section_nr to > mem_section can be done in O(1). > > Let's pass section_nr instead of mem_section ptr to > find_memory_block() in order to reduce needless iterations. > > Signed-off-by: Ohhoon Kwon Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb