Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp624124pxb; Wed, 15 Sep 2021 09:24:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDjva8vLuvXBEfB3r3J/+Ko+IKPWeFovFS4ovHVbi9X30VRMralL9LEnJ9+y0hLyi+EwII X-Received: by 2002:a05:6e02:1a6b:: with SMTP id w11mr679782ilv.21.1631723098162; Wed, 15 Sep 2021 09:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631723098; cv=none; d=google.com; s=arc-20160816; b=jhIcYHqvRlORSX9vlHkXYbHAMcg/zidH53+0ZsT2vVs4LuULk3tgJJwQOJxw5ZAiiN l5IvSFMwVB/sx6uDsc9XfuvwCdYme0SCsrHSv7jGhytcUWN666pApRtsTnQIoTo8N9M0 cRfK/vCNexVFI/QCI1FvVrc0KpHAr/ZA0r3nNbJmE09RUEdhTm+npKHVk9qLpWELBirB ofdCBJ0V6hBCqQxvg/aMT/QBEFJYVY414skuZ09CudPGfdQ8AbZIOONDNbrEHC07f5lb OojsLuiQUEphGPuACDQqsoI+YH5VfAl22TpXl5fZnc3yHBqvlk/Lq/mpk9QdMqBX9I2u i40w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uo9eXS3r1ePjhHgKEVY7iDRGL6C2CVufWx2q0EBxp6c=; b=f2WO+vWL5+bvgJYFwNx6W7f5TMg+05Fy5vCSE/g2BEiGXttHQrNj3LYIyLvEHwQgNm BxBeBOB3IJmqpp3uQOf5W10amKGJ++C1/vy/8yAviFhgD0hJTpMf4j/STnmORA2xgiz5 3G1CEfnKbAs9i1U1yvW3IpdZMD6QMsocEobMEQo/Ff8ZhWiJ9x/bJU5QldsEAQYBIONP d0pjKxFo5GGnF+XTsJxQ/0ufrpEPk9oV94dHPDKgMoTbN3rBCHjAWPK6f+rTRtNagJUr dCeYRA+TXttZukCjc0oew+CzEIQybcGxhOLGC64a6qsJOY3ivHvrnu3fukZqJedzvE4G A2DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=VbSQ6m+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si321717ilh.176.2021.09.15.09.24.44; Wed, 15 Sep 2021 09:24:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=VbSQ6m+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbhIOQYK (ORCPT + 99 others); Wed, 15 Sep 2021 12:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229467AbhIOQYJ (ORCPT ); Wed, 15 Sep 2021 12:24:09 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C75AC061574 for ; Wed, 15 Sep 2021 09:22:51 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so5343167pjr.1 for ; Wed, 15 Sep 2021 09:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uo9eXS3r1ePjhHgKEVY7iDRGL6C2CVufWx2q0EBxp6c=; b=VbSQ6m+QZ2Ovtk44be3X7yH2ZcuXgRlB+8QKMGJHG/EN0obGcxP9LIOS9PpfBAjt5s SdgAt7cKxRsI40DCPobdI9zsLGClZhLcAGTSarAKUV3NQDMDUhcEMY4xw7/LU5yGUNxZ lv2KdmqEUqRmftpvW/6jXrZUy58U8iLvue7Foxpx7qe7UaSOxcAB3k/JLO9vOBt4uKl5 ki+GbQMJADLKXRYjzsFUQrZ2gpF1bc+HYMEmyPpV0U+tRPUxi+toWEwSRCR90rSiM8Yc YLxyMlCRsOjX8KJhi+8L6utnlNCPt8OjbFduBG6YqMnH7BMFfFGm7UHuF0yfK+/qlCng Rlmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uo9eXS3r1ePjhHgKEVY7iDRGL6C2CVufWx2q0EBxp6c=; b=og8QGcQ0CrzhPypLozpYxPTJiRhkZp8afnvxDYc1EiUgDM0oK6AHE+F/fvJSTB53GZ y8RHWavJdFLEqLjDBJIyEA1BOR//Tu+Duki1p5X6bp3T5eEW/6kW/zEjlrzGbnfcFs40 5+OH2qUOnJWcEN9NeOKg9n1sdBJdv7Z9QElGDkZ+GzIgXZ1Gfll1/GwsGHEK1XyBsbz1 wzRSBasMMFvjVK8WDvYufOr/9qKhGY1AleOnnvWQ9CrTVcp2aexSG05GVcd/sTNT5VJ8 ZjuioD4VKKaioi4g4oBlcYdRGFXeUJAMbux9I9OnRXJGcvzZd35JlfTJ6EXmeS7AH5l6 CYsg== X-Gm-Message-State: AOAM531vBUP8MckR5oNXnivyNwbs0YeGm241F6P8vm6P6fkNQRMg6swJ W8gPKuTyobvE1RGHwWmtzrNODPvvtgWBIK3peJOioA== X-Received: by 2002:a17:90b:3b84:: with SMTP id pc4mr658569pjb.220.1631722970520; Wed, 15 Sep 2021 09:22:50 -0700 (PDT) MIME-Version: 1.0 References: <20210910124628.6261-1-justin.he@arm.com> In-Reply-To: From: Dan Williams Date: Wed, 15 Sep 2021 09:22:39 -0700 Message-ID: Subject: Re: [PATCH v2] device-dax: use fallback nid when numa node is invalid To: Justin He Cc: Vishal Verma , Dave Jiang , David Hildenbrand , Linux NVDIMM , Linux Kernel Mailing List , nd Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 11:51 PM Justin He wrote: [..] > > > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c > > > index fb775b967c52..d3a0cec635b1 100644 > > > --- a/drivers/acpi/nfit/core.c > > > +++ b/drivers/acpi/nfit/core.c > > > @@ -3005,15 +3005,8 @@ static int acpi_nfit_register_region(struct > > > acpi_nfit_desc *acpi_desc, > > > ndr_desc->res = &res; > > > ndr_desc->provider_data = nfit_spa; > > > ndr_desc->attr_groups = acpi_nfit_region_attribute_groups; > > > - if (spa->flags & ACPI_NFIT_PROXIMITY_VALID) { > > > - ndr_desc->numa_node = acpi_map_pxm_to_online_node( > > > - spa->proximity_domain); > > > - ndr_desc->target_node = acpi_map_pxm_to_node( > > > - spa->proximity_domain); > > > - } else { > > > - ndr_desc->numa_node = NUMA_NO_NODE; > > > - ndr_desc->target_node = NUMA_NO_NODE; > > > - } > > > + ndr_desc->numa_node = memory_add_physaddr_to_nid(spa->address); > > > + ndr_desc->target_node = phys_to_target_node(spa->address); > > > > > > /* > > > * Persistence domain bits are hierarchical, if > > > =================================================== > > > > > > Do you still suggest fixing like this? > > > > Are you saying that ACPI_NFIT_PROXIMITY_VALID is not set on your > > platform, or that pxm_to_node() returns NUMA_NO_NODE? > > > Latter, ACPI_NFIT_PROXIMITY_VALID is *set* in my case. > > > I would expect something like this: > > > > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c > > index a3ef6cce644c..95de7dc18ed8 100644 > > --- a/drivers/acpi/nfit/core.c > > +++ b/drivers/acpi/nfit/core.c > > @@ -3007,6 +3007,15 @@ static int acpi_nfit_register_region(struct > > acpi_nfit_desc *acpi_desc, > > ndr_desc->target_node = NUMA_NO_NODE; > > } > > > > + /* > > + * Fallback to address based numa information if node lookup > > + * failed > > + */ > > + if (ndr_desc->numa_node == NUMA_NO_NODE) > > + ndr_desc->numa_node = memory_add_physaddr_to_nid(spa- > > >address); > > + if (ndr_desc->target_node == NUMA_NO_NODE) > > + phys_to_target_node(spa->address); > > + > > Would it better to add a dev_info() here to report this node id changing? Yes, given all the possibilities here, a dev_info() reporting the final result of the node mapping is justifiable.