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 C17CBC11F68 for ; Fri, 2 Jul 2021 17:55:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 556A961402 for ; Fri, 2 Jul 2021 17:55:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 556A961402 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E59186B0036; Fri, 2 Jul 2021 13:55:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E09638D0002; Fri, 2 Jul 2021 13:55:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CAA738D0001; Fri, 2 Jul 2021 13:55:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id A3F016B0036 for ; Fri, 2 Jul 2021 13:55:35 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4CAF98249980 for ; Fri, 2 Jul 2021 17:55:35 +0000 (UTC) X-FDA: 78318400230.08.1796C5C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf30.hostedemail.com (Postfix) with ESMTP id C1CA0E0016B0 for ; Fri, 2 Jul 2021 17:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625248534; 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=FsMHQ2Zifcmtaxkds5D852KqicW7qep5Pp/XRrxxuUbzYI2rz+8M/ucizTOpyem4s9HyQx 3kXQUcAnepUhcVQgg5YjudWxjfWyGoF1jLjeySUPxPQWXe5erAZypQZ1bsonFKUVjoYdYr /qlM2WhR/kxLNW4yYiEF7x6bmtXF9tE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-364-4Qmg55eoPE6DLxrAopJ97g-1; Fri, 02 Jul 2021 13:55:31 -0400 X-MC-Unique: 4Qmg55eoPE6DLxrAopJ97g-1 Received: by mail-wr1-f71.google.com with SMTP id r11-20020a5d52cb0000b02901309f5e7298so827089wrv.0 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=CKLFX4/nxUP35G8IybteT4lcTToLGgI5/0lHVCCyG9QPXyrtfxtVDA8QZxYF0CQWOn ZlAPPfcPyRo9ua9FjXBLA9OYUaZ8r0AACMggKsTcGTAXmVoD1VFCJkd0kQRRIHAc34vo +et2M/SdAGmRM6qDRtnj5FefxYzCqe76VMt0FMPLLTtfQsx+ukj/wlRit0H1iHdPniiL Vz6EAc2KzTKUVqMc20E3d+jVe++w/8B5MrRhSW/dDO6dM3CCYzAfYGtT5aHPzwWjGkCI pXGJfYOIDYDkoTEcN0L9w768IKczC6WNZQZnGWwYTVmAkyHVs5I8qOJg9nsk4s7oX8aa ERfg== X-Gm-Message-State: AOAM533/yYO7jOuJ06PbnRb3YCOE2sXUcYp+WyTYp/gQ2ReRrWOGe4Sf uEvosqmuRmvok+Cenqv4Jg3QQbPAlw09mWZ3oFW/reaCjLbxafddqSsZrN4pJkr6W5PaUY7r8OD tcdpSMY2E0Ig= X-Received: by 2002:a05:600c:4410:: with SMTP id u16mr708287wmn.143.1625248529963; Fri, 02 Jul 2021 10:55:29 -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> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FsMHQ2Zi; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf30.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: ng3jzm5zbhakmeskzh8mymd6dn4p9kdh X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C1CA0E0016B0 X-HE-Tag: 1625248534-54121 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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