Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1073093yba; Sun, 31 Mar 2019 21:59:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZSXEXtPDJehUfmgD/6D+Od4uLPK9smh+XKO5Bcg0rttW51djX59Pl3eHdmxr4uNhdjqxe X-Received: by 2002:a63:5858:: with SMTP id i24mr58180471pgm.222.1554094787277; Sun, 31 Mar 2019 21:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554094787; cv=none; d=google.com; s=arc-20160816; b=O+dK7jcsquaZqKNmArs/Hu61kN3Hlz1tKYd9jVC8OB67y5QwPaYH0QAZuU9T384VF5 hvmy9wOk9+oFqseftJ5zpBCXOt+Ux+/Zkbl5WX91f4207M5Mz7qIBp1lwreStIb8t279 IcVJ9mfYsxOY9eD3NZZb1jpzeQrazKkoaMRj4hHNrIYEsx2xtvu9EB8SNClLaTUsydxL UXlo5O/EIHGE9v6AhhHIN0SQRUOXKi2/dlUMNAKhdlUfTh6GBs4DMHgTAQZVrbYOjVB0 Kg60u1QbWDNM7yHGIfjVUGgSFlS3kqCh8Q9/trPx0yqtp5qKqrtBfnF4SLhYE5C+k6D9 mo1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ej2Q0qRvz8B14shkQbVDplcYjITBeWriGFg8TVeUH90=; b=y4pVcRcXyCiQ1nFdIBjxxvDvZJAXdMX7fY5pGrTXLWr25PSozoXKfEs/3zi5JvBI4m vBw4TtVxybXynWOcwq1MGvpp6dt4fjMMXFia8LHmizhWlaVPeF+c/NvOsJ1e7yvhbUMq sKfAkHa68vt6RiURNUnWMrFye4JwWekXYJx68Ab6hIOORDjRkNCrFD+smnGWhEXT7Xki eIZClghTYgOnB5CNloSs43uBC/dmoOcLL9TFlcL9980unv97UI/kLkDOeTxHzzZJwnZh DPSX6zpitUXdq/loFR5syKtxWo+MTrVC4nJcpDMbfpTgpJI2SfAl2fRLp1ORUCzlcWd7 MPdA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si7768551pln.65.2019.03.31.21.59.30; Sun, 31 Mar 2019 21:59:47 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbfDAE64 (ORCPT + 99 others); Mon, 1 Apr 2019 00:58:56 -0400 Received: from mga17.intel.com ([192.55.52.151]:20665 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfDAE64 (ORCPT ); Mon, 1 Apr 2019 00:58:56 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2019 21:58:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,295,1549958400"; d="scan'208";a="160163267" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by fmsmga001.fm.intel.com with ESMTP; 31 Mar 2019 21:58:55 -0700 Date: Sun, 31 Mar 2019 23:00:16 -0600 From: Keith Busch To: Dan Williams Cc: Keith Busch , Linux Kernel Mailing List , Linux ACPI , Linux MM , Linux API , Greg Kroah-Hartman , Rafael Wysocki , Dave Hansen , Jonathan Cameron , Brice Goglin Subject: Re: [PATCHv8 07/10] acpi/hmat: Register processor domain to its memory Message-ID: <20190401050016.GA16792@localhost.localdomain> References: <20190311205606.11228-1-keith.busch@intel.com> <20190311205606.11228-8-keith.busch@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 29, 2019 at 02:15:03PM -0700, Dan Williams wrote: > On Mon, Mar 11, 2019 at 1:55 PM Keith Busch wrote: > > +static __init struct memory_target *find_mem_target(unsigned int mem_pxm) > > +{ > > + struct memory_target *target; > > + > > + list_for_each_entry(target, &targets, node) > > + if (target->memory_pxm == mem_pxm) > > + return target; > > + return NULL; > > The above implementation assumes that every SRAT entry has a unique > @mem_pxm. I don't think that's valid if the memory map is sparse, > right? Oh, we don't really care if multiple entries report the same PXM. We do assume there may be multiple entires with the same PXM and have tested this, but we're just allocating one memory target per unique memory PXM and consider multiple entires comprise the same memory target. That is okay if since we only need to identify unique PXMs and have no use for the adderss ranges that make up that target, which is the case for this series. I see you have a future use that has address ranges considerations, so separate targets for sparse ranges can definitely be added.