linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: herbert@gondor.apana.org.au, bruce.w.allan@intel.com,
	qat-linux@intel.com, john.griffin@intel.com,
	linux-crypto@vger.kernel.org, naleksan@redhat.com,
	davem@davemloft.net
Subject: Re: [PATCH 2/2] crypto: qat - Enforce valid numa configuration.
Date: Thu, 09 Oct 2014 17:42:59 -0400	[thread overview]
Message-ID: <54370163.6040305@redhat.com> (raw)
In-Reply-To: <5436E818.5030809@intel.com>



On 10/09/2014 03:55 PM, Tadeusz Struk wrote:
> On 10/09/2014 10:32 AM, Prarit Bhargava wrote:
>>> This calculation is sole for multi-socket configuration. This is why is
>>>> was introduced and what it was tested for.
>>>> There is no point discussing NUMA for single-socket configuration.
>>>> Single socket configurations are not NUMA. In this case dev->numa_node
>>>> is usually equal to NUMA_NO_NODE (-1) and adf_get_dev_node_id(pdev) will
>>>> always return 0;
>> The fact that you return an incorrect value here for any configuration is simply
>> put, bad.  You shouldn't do that.
> 
> Well I wouldn't say it is incorrect. adf_get_dev_node_id() returns the
> phys proc id the dev is connected to, so in single socket configuration
> there is only one socket 0.

That's not entirely true -- see my previous comment about
> 
>>
>>>> Please confirm that, but I think the system it panicked on was a two
>>>> sockets system with only node 0 populated with memory and accelerator
>>>> plugged it to node 1 (phys_proc_id == 1).
>>>> In this case adf_get_dev_node_id(pdev) returned 1 and this was passed to
>>>> kzalloc_node(size, GFP_KERNEL, 1) and because there was no memory on
>>>> node 1 kzalloc_node() panicked.
>> Yep; but my interpretation was that node 1 didn't exist at all and it panicked.
> 
> Why didn't exist? 

The reason the kernel panics is because there is only node 0.  Try allocating,
for example, from node 100.  You'll hit the same panic.   That's different than
saying node 0 has no memory ... I think we agree on this FWIW ... we just have
slightly different interpretations of the panic :)

The fact that there was no memory on node 1 doesn't
> make it disappear. There are two sockets in the platform 0 & 1 even
> though only one (node 0) has memory. The only problem with that is - it
> is far from optimal if device connected to node 1 uses memory on node 0.
> And this is what would happen if we would use dev_to_node(dev) here.
> 
>>
>>>> This patch will make sure that this will not happen and that the
>>>> configuration will be optimal.
>>>>
>> Yep, it will.  But what about cpu hotplug?
> 
> I don't think cpu hotplug matters here. This is one (probe) time
> determination if the configuration is optimal or not and if it makes
> sense to use this accelerator or not.

It absolutely matters.  num_online_cpus() *changes* depending on the # of cpus.

P.
> 

  reply	other threads:[~2014-10-09 21:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 17:38 [PATCH 0/2] crypto: qat - Fix for invalid dma mapping and numa Tadeusz Struk
2014-10-08 17:38 ` [PATCH 1/2] crypto: qat - Prevent dma mapping zero length assoc data Tadeusz Struk
2014-10-08 17:38 ` [PATCH 2/2] crypto: qat - Enforce valid numa configuration Tadeusz Struk
2014-10-08 17:57   ` Prarit Bhargava
2014-10-08 18:11     ` Tadeusz Struk
2014-10-08 18:35       ` Prarit Bhargava
2014-10-08 18:57         ` Tadeusz Struk
2014-10-08 19:01           ` Prarit Bhargava
2014-10-08 19:25             ` Tadeusz Struk
2014-10-09 11:23               ` Prarit Bhargava
2014-10-09 16:14                 ` Tadeusz Struk
2014-10-09 17:32                   ` Prarit Bhargava
2014-10-09 19:55                     ` Tadeusz Struk
2014-10-09 21:42                       ` Prarit Bhargava [this message]
2014-10-09 23:12                         ` Tadeusz Struk
2014-10-10 11:23                           ` Prarit Bhargava
2014-10-10 13:25                             ` Tadeusz Struk
2014-10-10 22:15                               ` Prarit Bhargava
2014-10-11 17:05                                 ` Tadeusz Struk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54370163.6040305@redhat.com \
    --to=prarit@redhat.com \
    --cc=bruce.w.allan@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=john.griffin@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=naleksan@redhat.com \
    --cc=qat-linux@intel.com \
    --cc=tadeusz.struk@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).