All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bowers, AndrewX <andrewx.bowers@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S79-V2 02/13] i40e/i40evf: spread CPU	affinity hints across online CPUs only
Date: Thu, 31 Aug 2017 20:47:10 +0000	[thread overview]
Message-ID: <26D9FDECA4FBDD4AADA65D8E2FC68A4A10EA9525@ORSMSX104.amr.corp.intel.com> (raw)
In-Reply-To: <20170829093242.41026-2-alice.michael@intel.com>

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, August 29, 2017 2:33 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S79-V2 02/13] i40e/i40evf: spread CPU
> affinity hints across online CPUs only
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> Currently, when setting up the IRQ for a q_vector, we set an affinity hint
> based on the v_idx of that q_vector. Meaning a loop iterates on v_idx, which
> is an incremental value, and the cpumask is created based on this value.
> 
> This is a problem in systems with multiple logical CPUs per core (like in SMT
> scenarios). If we disable some logical CPUs, by turning SMT off for example,
> we will end up with a sparse cpu_online_mask, i.e., only the first CPU in a
> core is online, and incremental filling in q_vector cpumask might lead to
> multiple offline CPUs being assigned to q_vectors.
> 
> Example: if we have a system with 8 cores each one containing 8 logical CPUs
> (SMT == 8 in this case), we have 64 CPUs in total. But if SMT is disabled, only
> the 1st CPU in each core remains online, so the cpu_online_mask in this case
> would have only 8 bits set, in a sparse way.
> 
> In general case, when SMT is off the cpu_online_mask has only C bits set:
> 0, 1*N, 2*N, ..., C*(N-1)  where
> C == # of cores;
> N == # of logical CPUs per core.
> In our example, only bits 0, 8, 16, 24, 32, 40, 48, 56 would be set.
> 
> Instead, we should only assign hints for CPUs which are online. Even better,
> the kernel already provides a function, cpumask_local_spread() which takes
> an index and returns a CPU, spreading the interrupts across local NUMA
> nodes first, and then remote ones if necessary.
> 
> Since we generally have a 1:1 mapping between vectors and CPUs, there is
> no real advantage to spreading vectors to local CPUs first. In order to avoid
> mismatch of the default XPS hints, we'll pass -1 so that it spreads across all
> CPUs without regard to the node locality.
> 
> Note that we don't need to change the q_vector->affinity_mask as this is
> initialized to cpu_possible_mask, until an actual affinity is set and then
> notified back to us.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c     | 16 +++++++++++-----
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c |  9 ++++++---
>  2 files changed, 17 insertions(+), 8 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



  reply	other threads:[~2017-08-31 20:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29  9:32 [Intel-wired-lan] [next PATCH S79-V2 01/13] i40e: add private flag to control source pruning Alice Michael
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 02/13] i40e/i40evf: spread CPU affinity hints across online CPUs only Alice Michael
2017-08-31 20:47   ` Bowers, AndrewX [this message]
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 03/13] i40e: re-enable PTP L4 capabilities for XL710 if FW >6.0 Alice Michael
2017-08-31 19:01   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 04/13] i40e: redfine I40E_PHY_TYPE_MAX Alice Michael
2017-08-31 19:02   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 05/13] i40e: fix incorrect register definition Alice Michael
2017-08-31 19:03   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 06/13] i40e/i40evf: use DECLARE_BITMAP for state Alice Michael
2017-08-31 19:03   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 07/13] i40e: fix merge error Alice Michael
2017-09-01 17:59   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 08/13] i40e: Display error message if module does not meet thermal requirements Alice Michael
2017-09-05 22:45   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 09/13] i40e: Properly maintain flow director filters list Alice Michael
2017-09-05 18:45   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 10/13] i40e: implement split PCI error reset handler Alice Michael
2017-09-01 18:36   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 11/13] i40e: do not enter PHY debug mode while setting LEDs behaviour Alice Michael
2017-09-01 18:37   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 12/13] i40evf: enable support for VF VLAN tag stripping control Alice Michael
2017-09-01 18:39   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 13/13] i40e: ignore skb->xmit_more when deciding to set RS bit Alice Michael
2017-09-05 18:47   ` Bowers, AndrewX
2017-08-31 18:59 ` [Intel-wired-lan] [next PATCH S79-V2 01/13] i40e: add private flag to control source pruning Bowers, AndrewX

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=26D9FDECA4FBDD4AADA65D8E2FC68A4A10EA9525@ORSMSX104.amr.corp.intel.com \
    --to=andrewx.bowers@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.