Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6172679ybc; Wed, 27 Nov 2019 16:35:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzfITb0FZloJt4toqY2r6mfaQPa494VrV2ev23N0viXIMxrnhiCeRedTsLwmUw22/yl9JTD X-Received: by 2002:a17:906:5211:: with SMTP id g17mr52539891ejm.60.1574901336068; Wed, 27 Nov 2019 16:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574901336; cv=none; d=google.com; s=arc-20160816; b=FvO6zYEwl/jmZEGdAcViw8vcgWAixb2+nW5OtBKZvBo3H4iTe8x5q1MNIjkZ7DwX85 24bxslv2sfr6t+UL1mosKMCIKfJwTk4AA2/EuHuKCm0N/aCvABlQxZZUih4YwPel4EJe u83Q1r/U9YVIGioDHTOfzbjoYWmiDdzUOirTKO16208oH3UkU3Q+yj/qBoXuoumQ4SWZ 4HNRjF0bN6zKWx5VK538k+NPrt3GJafrx4e3TZxJwUyTkWerYNf1qF/9JT3GMxddKZxq 5oyMKp1Ak/Q+moATagoSopiM5xjEEapzrUUK3STxGkvm71jPMTyLkF4GGK6sK7MXCQ6j 7p+w== 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=eBgl7IWFbAHYtCfwdXLuSMLWEguEG/dbDeqB2MJbK2k=; b=NoAX79S5g/U3FRMUnKz7yK7k1AYnwU1PAczPBorsgoEbz/PAoSaZXZa0QggBscdAJK T80Bp3g6TZiX3SVNiL4JmMuOKNcjgy4xwcQxVHmzLMCf+NP22kJjsppsaFqPm+NnpO5r VStayloZQIXXruDcwtyu0mWWlbhErEO7uM4vqfIcYMiMmxuYYOgAhR34oK1aNVdqG2VV kJkK4GdHH7ZJNXNWjW6gLEafyfTJnB5EtXopClEa/XE1hfT0fsQG3zeWwqnePLlo+rhX 4Yux0pde9ePV66enuP567lrgsr0P9EWTqY6X5rFXk37IWQjEu7qUVRAGqAgvyoXeIQaW ck4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=QshOovUW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20si11302667edn.178.2019.11.27.16.35.11; Wed, 27 Nov 2019 16:35:36 -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=fail header.i=@gmail.com header.s=20161025 header.b=QshOovUW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727127AbfK1Ad1 (ORCPT + 99 others); Wed, 27 Nov 2019 19:33:27 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:43841 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbfK1Ad1 (ORCPT ); Wed, 27 Nov 2019 19:33:27 -0500 Received: by mail-ot1-f66.google.com with SMTP id l14so20714179oti.10 for ; Wed, 27 Nov 2019 16:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eBgl7IWFbAHYtCfwdXLuSMLWEguEG/dbDeqB2MJbK2k=; b=QshOovUWthIqNFsT2YJCKBP1tF4y12XbFarYrmSV5KFvwfrFOuDNEtU8X8hBqyTNjM 0n0LvpLgeSOsBnCxR8XVYTKjgd63lj/QiW03wklwb9Pi4TOOFvNB0SsBxUZ9G+ojVFcZ hK3qWu71xk2BupXpLm52soK9NB2g7aYzM5fcRXSQ5vEGDGhqP8mRvDjSrc6YXeDOlNkH 5pcy2RduEYp4s36tG389w6+pUTxt5eEanyGqbkwjULEZecaU+vJBe4Dz8YOfC3Df088c i91EhfO8HyJtOxhL8xTfPVBt8N1zpWbf0olehu+oBSYqy8kvOxf7l0d42Cvd+Ita7y1t Lg7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eBgl7IWFbAHYtCfwdXLuSMLWEguEG/dbDeqB2MJbK2k=; b=NEPtzImJahsuuBCHBCsXQx9fcRVLqvq9MKp3f3hrgzaXMCwn0zT4hOMXq8AfDmJ8+P ujm9QBudelzos7dR81EYbhP4w/lvdcd5Kyb+0+Hz1g8mgD5urw3swPhFDMXjH7YfzZIV 8j1LeKuP4e/iBPw9MJ3cyJcMJCSEJGCvrRCBQpzVdF74608vuaR+5xb+UcFNEpxxOMVO BoO2I5CC230pZ5UrdJCFw+3PwPBgBO9pAwCZHLo7Gh3UqXZ0JAkYL5NYcTgaRs4efJa8 gVJ7ow6oJOL7wVTrhRJl1Q5E38oqHuNUKUzinhFpXC7VTsTOwsNC2mSZu/+WnqtAYejD 7VlA== X-Gm-Message-State: APjAAAXM9dvdEMf/lQrFhtFQLn3r98G8025h9AaLvr8TRelv+V8KQqVl 4JZ4ifbczBp13d8Jg2mJ8aaFSBiD X-Received: by 2002:a9d:739a:: with SMTP id j26mr5713049otk.40.1574901205522; Wed, 27 Nov 2019 16:33:25 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 94sm5475523otx.3.2019.11.27.16.33.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2019 16:33:24 -0800 (PST) Subject: Re: [PATCH] driver core: Fix test_async_driver_probe if NUMA is disabled To: Alexander Duyck , Greg Kroah-Hartman Cc: "Rafael J . Wysocki" , linux-kernel@vger.kernel.org References: <20191127202453.28087-1-linux@roeck-us.net> <4a2aa8554933c2d004761d5f3e8132018be5ea27.camel@linux.intel.com> <377feb00-9288-e03c-b8a7-26ba87e24927@roeck-us.net> From: Guenter Roeck Message-ID: Date: Wed, 27 Nov 2019 16:33:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/27/19 3:13 PM, Alexander Duyck wrote: > On Wed, 2019-11-27 at 14:42 -0800, Guenter Roeck wrote: >> On 11/27/19 1:24 PM, Alexander Duyck wrote: >>> On Wed, 2019-11-27 at 12:24 -0800, Guenter Roeck wrote: >>>> Since commit 57ea974fb871 ("driver core: Rewrite test_async_driver_probe >>>> to cover serialization and NUMA affinity"), running the test with NUMA >>>> disabled results in warning messages similar to the following. >>>> >>>> test_async_driver test_async_driver.12: NUMA node mismatch -1 != 0 >>>> >>>> If CONFIG_NUMA=n, dev_to_node(dev) returns -1, and numa_node_id() >>>> returns 0. Both are widely used, so it appears risky to change return >>>> values. Augment the check with IS_ENABLED(CONFIG_NUMA) instead >>>> to fix the problem. >>>> >>>> Cc: Alexander Duyck >>>> Fixes: 57ea974fb871 ("driver core: Rewrite test_async_driver_probe to cover serialization and NUMA affinity") >>>> Signed-off-by: Guenter Roeck >>>> --- >>>> drivers/base/test/test_async_driver_probe.c | 3 ++- >>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/base/test/test_async_driver_probe.c b/drivers/base/test/test_async_driver_probe.c >>>> index f4b1d8e54daf..3bb7beb127a9 100644 >>>> --- a/drivers/base/test/test_async_driver_probe.c >>>> +++ b/drivers/base/test/test_async_driver_probe.c >>>> @@ -44,7 +44,8 @@ static int test_probe(struct platform_device *pdev) >>>> * performing an async init on that node. >>>> */ >>>> if (dev->driver->probe_type == PROBE_PREFER_ASYNCHRONOUS) { >>>> - if (dev_to_node(dev) != numa_node_id()) { >>>> + if (IS_ENABLED(CONFIG_NUMA) && >>>> + dev_to_node(dev) != numa_node_id()) { >>>> dev_warn(dev, "NUMA node mismatch %d != %d\n", >>>> dev_to_node(dev), numa_node_id()); >>>> atomic_inc(&warnings); >>> >>> I'm not sure that is really the correct fix. It might be better to test it >>> against NUMA_NO_NODE and then if it is not that make sure that it matches >>> the node ID. Adding the check against NUMA_NO_NODE would resolve the issue >>> for cases where the device might be assigned to multiple NUMA nodes. >>> >> I think you are suggesting that dev_to_node(dev) might return NUMA_NO_NODE >> even on systems with CONFIG_NUMA enabled. I have no idea if that can happen. >> The code in test_async_probe_init() seems to suggest that the node is set >> to a valid node id for all asynchronous nodes, so I don't immediately see >> how that could be the case. I may be missing something, of course. > > Well thinking back to the Nehalem architecture I seem to recall that there > were devices that were connected to a shared IOH that was accessible > across both nodes. I thought that they might have a node ID of > NUMA_NO_NODE since they didn't really belong to either of the two nodes in > the sytem. > > It would effectively work out the same as your patch compiler wise since > dev_to_node would be NUMA_NO_NODE in the non-NUMA case so it would compile > out the warning since it would fail the first check, and in the NUMA case > it would add an extra check to make sure that dev_to_node is actually > indicating the device needs a specific node in the NUMA enabled case. > I thought the code is specifically checking devices which it previously created, which are well defined and understood test devices. After all, the check is in the test driver's probe function. Guess I really don't understand the code. Please take my patch as bug report, and submit whatever fix you think is correct. Thanks, Guenter