Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8184977ybl; Thu, 16 Jan 2020 12:05:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyKp8tuiFjZbzjgHS7a0ioScwTk76EhUjTvtSJtxH2zZKNq37laztZ0//Xr1GJ8A+n4yLDb X-Received: by 2002:a9d:7ac9:: with SMTP id m9mr3352216otn.80.1579205113848; Thu, 16 Jan 2020 12:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579205113; cv=none; d=google.com; s=arc-20160816; b=m05Qiys9EAUl+iDT4a1sT+D6O9X6jvcwKapExFM9pMxpRb6ycHcJgaT8yhbJTN+93m fNTu52P43XV5P2xRFPoR6ROE3E8+eUj3xnMtF43HuVm8fu/hUJhJaDIFNbtEYLOipC1/ otuxvWjfhUE7QhM4vX/E3hdQJ0u7WPRQsgdkYH3s2+FwnNOglQnIeiVGV3o7eNj25vOw 73hhtQwanxM2nND6B8eM2lEo7EHo/wWW6342HYyhwm+OY6zDgHMC4wbg92NkemK+Z+om 64uzaGJwPhJiDlSt3CIssQzRmWEzHqnlY6QsVKXN6EJ2D8o1wWdAI/3ADstGtwXLEpSR 2oiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Q9O76iCwXxuBVXY0EPgkjSgjg+Zhx6547dbKvdv2dvA=; b=lWUN5cFuLWvd+4ERiNcUmk4KPrHt9ecBAEWq6fQSlNA/rOn9eFspp4sBh9KeG3zBck kxTq892fI0bE0C34vQqbhyW/CNP+ViayBJoYSxcKegEP1EW0ONviLHI9qmyuEkzrX1Bv buH0NRc/FZEHYd1Ks+whlfvzeoxp/dvE1wEOHMuFfjPRsVLYHCp57Dt4JM6rJWrQBsxF cXN8eZiIaAJ2ZLlzmUidMSj8nTE3OjnwXVnVpQBcysgybimH3o7Ye8yebtZINhG2LKkP 514FTGbK5LeZydQKKACF0aGowNPGlRuflAlELbOGvRu1RJy4+trd/ZeG2THfG/V4sBmb 6yFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TcwQskaz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g138si12844246oib.190.2020.01.16.12.04.58; Thu, 16 Jan 2020 12:05:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TcwQskaz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391732AbgAPRUo (ORCPT + 99 others); Thu, 16 Jan 2020 12:20:44 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44480 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391260AbgAPRSA (ORCPT ); Thu, 16 Jan 2020 12:18:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579195078; 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=Q9O76iCwXxuBVXY0EPgkjSgjg+Zhx6547dbKvdv2dvA=; b=TcwQskazko+fX1Uy36CC8QgAFA5BEvHavfqFv+BpTEXyMQsZIBWGVM6wzGmF9SleXDdARv LqEJQxj69zIv9m96w59ZwI29tgzNyEznZGcTx7ZKyeE5Ni86xSAIloOZiusDAVXmVqfrzC 3qqnAucrBWsiIQDYZDM83BlDK48SeXo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-t3v8Wxs2PeWEZuznrxHoPA-1; Thu, 16 Jan 2020 12:17:27 -0500 X-MC-Unique: t3v8Wxs2PeWEZuznrxHoPA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7DDB9800D53; Thu, 16 Jan 2020 17:17:05 +0000 (UTC) Received: from [10.18.17.160] (dhcp-17-160.bos.redhat.com [10.18.17.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id E607B842BA; Thu, 16 Jan 2020 17:17:01 +0000 (UTC) Subject: Re: [PATCH v4] drivers/base/memory.c: cache blocks in radix tree to accelerate lookup To: David Hildenbrand , Michal Hocko Cc: Scott Cheloha , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Greg Kroah-Hartman , Andrew Morton , nathanl@linux.ibm.com, ricklind@linux.vnet.ibm.com, Scott Cheloha References: <20191217193238-1-cheloha@linux.vnet.ibm.com> <20200109212516.17849-1-cheloha@linux.vnet.ibm.com> <181caae3-ffb8-c745-a4c9-1aef93ea6dd5@redhat.com> <20200116152214.GX19428@dhcp22.suse.cz> <765a07fe-47e9-fe3d-716a-44d9ee4a5e99@redhat.com> From: Don Dutile Message-ID: <007f0eed-0d42-f0de-8af4-acae69db0a42@redhat.com> Date: Thu, 16 Jan 2020 12:17:01 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <765a07fe-47e9-fe3d-716a-44d9ee4a5e99@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/16/20 10:28 AM, David Hildenbrand wrote: > On 16.01.20 16:22, Michal Hocko wrote: >> On Wed 15-01-20 20:09:48, David Hildenbrand wrote: >>> On 09.01.20 22:25, Scott Cheloha wrote: >>>> Searching for a particular memory block by id is an O(n) operation >>>> because each memory block's underlying device is kept in an unsorted >>>> linked list on the subsystem bus. >>>> >>>> We can cut the lookup cost to O(log n) if we cache the memory blocks in >>>> a radix tree. With a radix tree cache in place both memory subsystem >>>> initialization and memory hotplug run palpably faster on systems with a >>>> large number of memory blocks. >>>> >>>> Signed-off-by: Scott Cheloha >>>> Acked-by: David Hildenbrand >>>> Acked-by: Nathan Lynch >>>> Acked-by: Michal Hocko >>> >>> Soooo, >>> >>> I just learned that radix trees are nowadays only a wrapper for xarray >>> (for quite a while already!), and that the xarray interface shall be >>> used in new code. >> >> Good point. I somehow didn't realize this would add more work for a >> later code refactoring. The mapping should be pretty straightforward. > > Yes it is. @Scott, care to send a fixup that does the mapping? > >> >> Thanks for noticing! > > Don noticed it, so thanks to him :) > Backporting XArray to RHEL-8, and continuing to support radix-tree api in RHEL-8 due to RHEL rulz, it wasn't stable/bug-free everyewhere, etc., was a challenge, thus my 'sensitivity' to seeing new radix-tree code upstream. >